Having copied a live site to a new Gen.2 cloud with Modx-Cloud (PHP 7.4), a problem arises:
I have to disable ‘use Resizer’ for pThumb in the system settings. When using Resizer, ‘/www’ is prepended to the path to the generated images and the paramater ‘zc=1’ isn’t respected from the ImagePlus template (newsImageSmall) below.
After setting ‘use Resizer’ to false, the images get the correct path BUT the aspect-ratio of the images isn’t correct anymore and the cropping applied via the ImagePlus TV seems to be ignored.
How can I fix this?
Or is this a question a should pose to the people at Modx Cloud Support?
Not that I have much insight, but my understanding is, that the “Resizer” in pThumb is very outdated.
In general all these resize extras (pThumb, phpThumbOn, phpThumbOf, …) just seem to use the “phpThumb” version that is included in MODX.
“phpThumb” then relies on the underlying graphics libraries to create the thumbnails.
My guess is, that there is maybe a new version of GD (or ImageMagick) on the server that is not compatible with the “phpThumb” version in MODX. Maybe you can check the version of GD with phpinfo().
I think you’re right about the outdated pThumb, so I uninstalled that and Resizer as well in order to rely on phpThumb.
In the website ‘/www’ is still prepended to the image path and no cropping is applied.
Yes the cropping works correctly when I call it directly as you suggested.
For the direct call it would be phpThumb, which is the default in ModX, as you said.
But ImagePlus requires pThumb according to Image+ - Image+ | MODX Documentation
So I’m not sure what to do.
I guess ImagePlus does not work with the default phpThumb? So which one of the Thumbs would you recommend – as they are all outdated?
With phpThumpOn or without any thumb extra the output of [[+crop.options]] is sx=1154&sy=969&sw=4500&sh=2727 (added to the imagePlus template from above).
So if you combine this with the other settings from the pthumb call (&h=344&w=682&zc=1&q=85&f=webp) and add it to the phpthumb-connector (connectors/system/phpthumb.php), do you get the same output?
And this worked correctly on your old server? Or just when using Resizer?
Maybe set an “Aspect Ratio” in the Image+ configuration, so you don’t have to use height (&h), width (&w) and zoom-crop (&zc=1) in combination with the crop settings.
That means I have to report a bug to Modx? Although I’m thinking ImagePlus requires an Extra (which has a bug) so it’s a bit of an ImagePlus problem as well, isn’t it?
I’m lost here but thanks for answering anyway.
If it really is a problem with phpThumb then this doesn’t help.
No. ImagePlus requires an Extra that uses a MODX class (modPhpThumb) that uses a PHP library (which has a bug). What exactly should the author do about that?