TV (type Image) no preview showing when source is SVG image

Please can anyone else reproduce this problem or help? - This SVG previews actually used to work but something changed and I cannot figure out what it is. The previews work in the Modx file browser but not for TVs. I’ve searched all the other threads I can find on this but not able to come up with anything.


Template variable (type Image), image preview doesn’t work when image source is an SVG file

Step to reproduce

Set up a template variable with type “Image” and assign it to a template & then assign the template to a resource. Upload, select & save an image of type SVG.

Observed behavior

Image preview doesn’t show up and the following entry appears in the Modx error log…

[2022-04-26 17:33:15] (ERROR @ /home/user/public_html/core/model/phpthumb/modphpthumb.class.php : 165) phpThumb was unable to generate a thumbnail for: /home/user/public_html/core/cache/phpthumb/user.com__src2f3d6164b4fe059fb1edfb405a275dd8_par50a064df300e664cfff2fbd5ed8df8e3_dat1650994352.png
[2022-04-26 17:33:15] (ERROR @ /home/user/public_html/core/model/phpthumb/modphpthumb.class.php : 177) Error outputting thumbnail:
OutputThumbnail() failed because !is_resource($this->gdimg_output) in file “phpthumb.class.php” on line 640

Expected behavior

Should generate a PNG preview. Works when the image source is JPG or PNG but not for SVG


Modx 2.8.3-pl , PHP 7.3, ImageMagick 6.9.10-68

Maybe this got fixed by this PR.

Brilliant, thank you so much… that solves the problem… this one’s been bugging me for ages!

1 Like

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”.