We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 49710
    • 92 Posts
    Hello,

    I use PHPthumbOf within MIGX to handle a gallery.
    But PHPthumbOf do not work. The images shoes up in fullsize.

    The Log says something like that:

    [2015-04-03 18:43:54] (ERROR @ /dev/connectors/index.php) Could not load class: GalleryAlbumsMediaSource from mysql.galleryalbumsmediasource.
    [2015-04-03 18:44:00] (ERROR @ /www/htdocs/wXXXXX/domain.de/dev/core/model/phpthumb/phpthumb.class.php : 1596) PHP warning: getimagesize(/www/htdocs/wXXXXX/domain.de/dev/dev/assets/content/galerien/testgalerie/_MG_1004-Bearbeitet.jpg): failed to open stream: No such file or directory
    [2015-04-03 18:44:00] (ERROR @ /dev/index.php) [phpThumbOf] Could not generate thumbnail: assets/content/galerien/testgalerie/_MG_1004-Bearbeitet.jpg - Debug: Array
    (
    [0] => phpThumb() v1.7.13-201406261000 in file "phpthumb.class.php" on line 220
    [1] => setCacheDirectory() starting with config_cache_directory = "/www/htdocs/wXXXXX/domain.de/dev/core/cache/phpthumb/" in file "phpthumb.class.php" on line 961
    [2] => setting config_cache_directory to realpath(/www/htdocs/wXXXXX/domain.de/dev/core/cache/phpthumb) = "/www/htdocs/w0130f95/tobi-w-foto.de/dev/core/cache/phpthumb" in file "phpthumb.class.php" on line 989
    [3] => setCacheDirectory() starting with config_cache_directory = "/www/htdocs/wXXXXX/domain.de/dev/assets/components/phpthumbof/cache/" in file "phpthumb.class.php" on line 961

    and so on....


    The MODx Installation is in "domain.de/dev" - so I wondering that the log says that ist can not find something in ...domain.de/dev/dev....
    Why ist there a second /dev ? Can this be the reason why it won't work?
    PHP warning: getimagesize(/www/htdocs/wXXXXX/domain.de/dev/dev/assets/content/galerien/testgalerie/_MG_1004-Bearbeitet.jpg): failed to open stream: No such file or directory
    How can I fix it?

    I call PHPthumbOf within a chunk:
     <img src="[[+image:phpthumbof=`h=300&zc=1`]]" alt="[[+title]]"/>
      • 49710
      • 92 Posts
      I figured out that the problem is on an other way known als "Double-Slash-Problem". In my case the installation is in "domain.de/dev"
      Therefor it makes the two "dev/dev" in the path.
      I played a little bit with the mediasorces. In my case the "basePath option" etc is empty. Until now ist worked all well.
      When i put a simple / in the basePath, PHPthumbOf works well. BUT, then all other images do not work.

      What can I do to get it all work together?
        • 49710
        • 92 Posts
        The solution was:
         <img src="[[+image:replace=`[[++base_url]]==/`:phpthumbof=`h=300&zc=1`]]" alt="[[+title]]"/>


          • 49710
          • 92 Posts
          Hm.....very strange stuff going on. Yesterday I figured out the solution and it worked. Then I change the size (h) from 300 to 200 and it wont worked (it generated the double slashes again). Than i change it back to 300 and it worked.....strange enough...
          But today I give it a new try to change ist to 200 and it do not work again. As I changed it back to 300 it won't work anymore...still now...

          What the h**** ist that?
          Any sugestions?
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            Do not use the phpthumbof extra. Use the pthumb extra. You can still use the phpthumbof output modifier, since pthumb provides a copy of its pthumb snippet with the name 'phpthumbof' for backwards compatibility.
              Studying MODX in the desert - http://sottwell.com
              Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
              Join the Slack Community - http://modx.org
              • 49710
              • 92 Posts
              I figured out an workaround:
              1. I set the MEDIASOURCE -> basePath to "/".
              2. I wrote a custom output filter to delete the first "/" from images-pathes that are NOT in touch with the phpthumbof stuff
              (otherwise the images will not be found)

              So that worked for me. But I really can't stand why this problem is there.
                • 38723
                • 165 Posts
                Quote from: sottwell at Apr 04, 2015, 06:33 AM
                Do not use the phpthumbof extra. Use the pthumb extra. You can still use the phpthumbof output modifier, since pthumb provides a copy of its pthumb snippet with the name 'phpthumbof' for backwards compatibility.

                +1 for pThumb - it's substantially faster on larger sites than phpThumbOf