We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • Quote from: mIDO at Jul 29, 2013, 09:38 AM

    jgrant, the command returns /usr/bin/convert
    I have no functions disabled.

    Hmm, then ImageMagick is available and the next question is whether phpThumb is finding it or not. To determine that you have to look at the debug messages phpThumb generates when it runs.

    Edit the phpThumbOf snippet and change the last line from
    return $thumbnail->render();

    to
    $debug = TRUE;
    $image = $thumbnail->render();
    if ($debug) {
        $modx->log(modX::LOG_LEVEL_ERROR, 'phpThumb debug output:' . substr(print_r($thumbnail->phpThumb->debugmessages, TRUE), 7, -2) . "----------------------\n");
    }
    return $image;
    


    Then either edit a resource using a zoom cropped image and replace the image with a new one or remove the existing image from the phpThumbOf cache, then visit the page. The idea is to make phpThumb generate a new image from scratch. Check the error log and copy & paste all the output it generates here, 20 lines or so.

    After you've got that, edit the phpThumbOf snippet again and change $debug to FALSE to turn off the logging.

    Or you could switch to pThumb, my fork of phpThumbOf. It's got this debug feature built in so you don't have to edit the snippet code, just change debug in the default properties from No to Yes.
      Extras :: pThumbResizerimageSlimsetPlaceholders
      • 19388
      • 297 Posts
      I get this error message:
      [9] => ImageMagickThumbnailToGD() aborting because cannot find convert in $this->config_imagemagick_path (), and `which convert` returned (which: no convert in ((null))) in file "phpthumb.class.php" on line 1131

      It's really strange because it's configured in system settings and "which convert" works fine when accessing from ssh. I have also other scripts working fine with ImageMagick.

      I think this is related with bug reported here:
      https://github.com/splittingred/phpThumbOf/issues/19

      I'll make some additional tests...
        • 19388
        • 297 Posts
        It's strange, $this->config_imagemagick_path is returning an empty string and which convert is null...
          • 19388
          • 297 Posts
          I don't really know the reason why this is happenning, but I've made the easy hack, changed the function to:
          function ImageMagickCommandlineBase() { return '/usr/bin/convert'; }

          And it works.

          I know that this is not the way it has to be done, but at least it works, until someone with more knowledge of the core than me can solve it.
          • Good you got it sorted.
            ImageMagickCommandlineBase() is finicky; I have also seen it refuse to identify convert even when it's clearly present.
              Extras :: pThumbResizerimageSlimsetPlaceholders
              • 19388
              • 297 Posts
              Really thanks for your help smiley
                • 19388
                • 297 Posts
                I've upgraded the site I hacked some time ago and the problem came again to me.
                I took a look to the new phpthumb.class.php and the function ImageMagickCommandlineBase() has been updated, but it's still not working for me.

                I changed the code ( Line 1313 )from:
                static $commandline = null;

                To:
                		static $commandline = null;
                		$commandline = '/usr/bin/convert';