We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21606
    • 46 Posts
    I have a site that is currently in progress on an ISP as well as locally in an xampp installation. Both installations are using 2.2.10pl.

    The gist of the problem is this - on the server (at ISP) where a work-in-progress website is located thumbnails seem to be properly processed on all pages. However when I move the site to my local workspace, it's xampp driven, the homepage thumbnails are correctly processed while other pages are not. Most notably the logo on the homepage for example is correctly resized but on other pages it's the original size. I've created a duplicate page of the home page using the home page template and the logo does correctly resize but if I just create a new page and apply the homepage template the thumbnails do not resize. I'm using pthumb because I initially began using phpthumbof and the update was straightforward as well as giving me some performance improvement.

    I already built a second site a different way in order to see if another approach may be helpful, but it wasn't.

    My next option would be to set up a dev area on the ISP but there are no guarantees that the problem would be solved and it'd be educational to understand what's happening.

    Below is an example of the error log on a page that thumbnails fail:

    [2014-01-09 18:38:05] (ERROR @ /bootstrap3.1-site/index.php) [pThumb] Resource: 23 || Image: J:/xampp/htdocs/bootstrap3.1-site/assets/img/logo-and-abbr-name-sm.png
    Could not generate thumbnail
    phpThumb debug output:
    [0] => phpThumb() v1.7.9-200712090829 in file "phpthumb.class.php" on line 216
    [1] => setSourceFilename(J:/xampp/htdocs/bootstrap3.1-site/J:/xampp/htdocs/bootstrap3.1-site/assets/img/logo-and-abbr-name-sm.png) set $this->sourceFilename to "J:/xampp/htdocs/bootstrap3.1-site/J:/xampp/htdocs/bootstrap3.1-site/assets/img/logo-and-abbr-name-sm.png" in file "phpthumb.class.php" on line 243
    [2] => file_exists() = 0 in file "phpthumb.class.php" on line 1101
    [3] => is_executable() = 0 in file "phpthumb.class.php" on line 1102
    [4] => ImageMagickThumbnailToGD() aborting because cannot find convert in $this->config_imagemagick_path (), and `which convert` returned () in file "phpthumb.class.php" on line 1131
    [5] => $AvailableImageOutputFormats = array(text;ico;bmp;wbmp;gif;png;jpeg) in file "phpthumb.class.php" on line 884
    [6] => $this->thumbnailFormat set to $this->config_output_format "jpeg" in file "phpthumb.class.php" on line 895
    [7] => $this->thumbnailFormat set to $this->f "png" in file "phpthumb.class.php" on line 902
    [8] => $this->thumbnailQuality set to "75" in file "phpthumb.class.php" on line 912
    [9] => $this->sourceFilename set to "J:/xampp/htdocs/bootstrap3.1-site/J:/xampp/htdocs/bootstrap3.1-site/assets/img/logo-and-abbr-name-sm.png" in file "phpthumb.class.php" on line 813
    [10] => phpThumb() v1.7.9-200712090829

    "J:/xampp/htdocs/bootstrap3.1-site/J:/xampp/htdocs/bootstrap3.1-site/assets/img/logo-and-abbr-name-sm.png" does not exist in file "phpthumb.class.php" on line 3647
    [11] => setCacheDirectory() starting with config_cache_directory = "J:/xampp/htdocs/bootstrap3.1-site/assets/components/phpthumbof/cache/" in file "phpthumb.class.php" on line 919
    [12] => setting config_cache_directory to realpath(J:\xampp\htdocs\bootstrap3.1-site\assets\components\phpthumbof\cache) = "J:\xampp\htdocs\bootstrap3.1-site\assets\components\phpthumbof\cache" in file "phpthumb.class.php" on line 947
    [13] => SetCacheFilename() _src set from md5($this->sourceFilename) "J:/xampp/htdocs/bootstrap3.1-site/J:/xampp/htdocs/bootstrap3.1-site/assets/img/logo-and-abbr-name-sm.png" = "b82ea0981cb03093349a6b1e51ff2f9d" in file "phpthumb.class.php" on line 3077
    [14] => SetCacheFilename() _par set from md5(_farC_h161_w140_dpi150) in file "phpthumb.class.php" on line 3110
    [15] => starting ExtractEXIFgetImageSize() in file "phpthumb.class.php" on line 2897
    [16] => GetImageSize("J:/xampp/htdocs/bootstrap3.1-site/J:/xampp/htdocs/bootstrap3.1-site/assets/img/logo-and-abbr-name-sm.png") failed in file "phpthumb.class.php" on line 2920
    [17] => $this->useRawIMoutput=true after checking $UnAllowedParameters in file "phpthumb.class.php" on line 1232
    [18] => ImageMagickThumbnailToGD() aborting because ImageMagickCommandlineBase() failed in file "phpthumb.class.php" on line 1865
    [19] => ImageMagickThumbnailToGD() failed in file "phpthumb.class.php" on line 2927
    [20] => SetOrientationDependantWidthHeight() starting with ""x"" in file "phpthumb.class.php" on line 2876
    [21] => SetOrientationDependantWidthHeight() setting w="140", h="161" in file "phpthumb.class.php" on line 2892
    [22] => EXIF thumbnail extraction: (size=0; type=""; 0x0) in file "phpthumb.class.php" on line 2979
    [23] => starting SourceImageToGD() in file "phpthumb.class.php" on line 3229
    [24] => $this->useRawIMoutput=true after checking $UnAllowedParameters in file "phpthumb.class.php" on line 1232
    [25] => ImageMagickThumbnailToGD() aborting because ImageMagickCommandlineBase() failed in file "phpthumb.class.php" on line 1865
    [26] => starting ImageCreateFromFilename(J:/xampp/htdocs/bootstrap3.1-site/J:/xampp/htdocs/bootstrap3.1-site/assets/img/logo-and-abbr-name-sm.png) in file "phpthumb.class.php" on line 3152
    [27] => empty $filename or GetImageSize(J:/xampp/htdocs/bootstrap3.1-site/J:/xampp/htdocs/bootstrap3.1-site/assets/img/logo-and-abbr-name-sm.png) failed in file "phpthumb.class.php" on line 3201
    [28] => Populating $rawimagedata in file "phpthumb.class.php" on line 3209
    [29] => cannot fopen(J:/xampp/htdocs/bootstrap3.1-site/J:/xampp/htdocs/bootstrap3.1-site/assets/img/logo-and-abbr-name-sm.png) in file "phpthumb.class.php" on line 3212
    [30] => Not using EXIF thumbnail data because $this->exif_thumbnail_data is empty in file "phpthumb.class.php" on line 3278
    [31] => $this->gdimg_source is still empty in file "phpthumb.class.php" on line 3330
    [32] => ImageMagickThumbnailToGD() failed in file "phpthumb.class.php" on line 3332
    [33] => phpThumb() v1.7.9-200712090829

    Unknown image type identified by "" () in SourceImageToGD()[3444] in file "phpthumb.class.php" on line 3647
    [34] => SourceImageToGD() failed in file "phpthumb.class.php" on line 323
    ----------------------

    I can see duplication in the path calls but don't know where to fix it. The site worked fine before I moved it to the server but upon moving it back I found this annoying problem.

    Thank you for taking some time to look at this.

    Nitrojane
    • The problem is I didn't consider Windows and its old 'drive letter mappings', so pThumb incorrectly interprets them as relative paths and tries to make them absolute for phpThumb by prepending MODX_BASE_PATH.
      I opened an issue for this. I'll correct this in the next release, but if you'd like to fix it now edit core/components/phpthumbof/model/phpthumbof.class.php, find line 270 and change it from:
      $this->phpThumb->setSourceFilename($this->input[0] === '/' ? $this->input : MODX_BASE_PATH . $this->input);

      to:
      $this->phpThumb->setSourceFilename(($this->input[0] === '/' || $this->input[1] === ':') ? $this->input : MODX_BASE_PATH . $this->input);


      That ought to fix it. Or if you change the 'Use Resizer' setting to Yes, that would sidestep this problem since it's specific to phpThumb.
        Extras :: pThumbResizerimageSlimsetPlaceholders
        • 21606
        • 46 Posts
        Thanks jgrant - that fixed the problem! I really appreciate your assistance.

        Jane