Images not resizing with pThumb and error diagnostics?


I’m getting an error in the console and wonder if anyone could tell me what it actually means. I have a web page with thumbnails generated to a specific size using pThumb but a couple of them are not resizing correctly and I can’t figure out why.

Modx 2.8.3
mysql 8.0.26
php 7.3.29
pthumb 2.3.3

Error specific to one of the images not resizing to the size set with pThumb:

[2021-08-05 09:42:17] (ERROR @ /home2/ : 156) [pThumb] Resource: 1 || Image: assets/shop/category images/greetings_cards_180x.jpeg
Could not generate thumbnail
phpThumb debug output:
    [0] => phpThumb() v1.7.16-202012161640 in file "phpthumb.class.php" on line 234
    [1] => setSourceFilename(/home/ images/greetings_cards_180x.jpeg) set $this->sourceFilename to "/home/ images/greetings_cards_180x.jpeg" in file "phpthumb.class.php" on line 299
    [2] => Addding ImageMagick formats to $AvailableImageOutputFormats (text;ico;bmp;wbmp;gif;webp;png;jpeg) in file "phpthumb.class.php" on line 1006
    [3] => $AvailableImageOutputFormats = array(text;ico;bmp;wbmp;gif;webp;png;jpeg) in file "phpthumb.class.php" on line 1012
    [4] => $this->thumbnailFormat set to $this->config_output_format "jpeg" in file "phpthumb.class.php" on line 1023
    [5] => $this->thumbnailFormat set to $this->f "jpeg" in file "phpthumb.class.php" on line 1030
    [6] => $this->thumbnailQuality set to "75" in file "phpthumb.class.php" on line 1040
    [7] => resolvePath: /home/ images/greetings_cards_180x.jpeg (allowed_dirs: Array
) in file "phpthumb.class.php" on line 1183
    [8] => resolvePath: iteration, path=/home/ images/greetings_cards_180x.jpeg, base path = /home2/ in file "phpthumb.class.php" on line 1202
    [9] => resolvePath: stop at component 2 in file "phpthumb.class.php" on line 1218
    [10] => resolvePath: stop at path=/home/mywebsite in file "phpthumb.class.php" on line 1221
    [11] => resolvePath: no match, returning null in file "phpthumb.class.php" on line 1223
    [12] => !$this->config_allow_src_above_docroot therefore setting "/home/ images/greetings_cards_180x.jpeg" (outside "/home2/") to null in file "phpthumb.class.php" on line 1394
    [13] => $this->sourceFilename set to "" in file "phpthumb.class.php" on line 933
    [14] => phpThumb() v1.7.16-202012161640

Thanks for any help

There is a space in the path to the file, between ‘category’ and ‘images’. Is this just a typo when putting the error into your post, or might there be a problem with the path to these files?

/home/ images/greetings_cards_180x.jpeg

I believe the problem is the location of the image file.
There seems to be a directory /home2/... where MODx runs and a directory /home/... where the image is located. These root-directories should be the same.


Thanks both and well spotted. My server was upgraded a few days ago so must be related.

SOLUTION: Turning on friendly URL’s seems to have fixed the issue!

This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.