Image+ does not save the cropped images

Good afternoon

I hope someone has an idea why the cropped images from the extra Image+ are not stored or where they are stored.

It’s possibile to crop the image in the TV - and the cropped version looks fine. While cropping and after saving the resource with the image+ TV. The cropped image stays still cropped.

In the file directory assets/components/phpthumbof/cache there are only the full sized images, but with a differnt file name (the behaviour of the cropped image).

Calling the pthumb with the sizes works also in the chunk - but with the full image from the assets folder.

I have no idea where the cropped images are stored and how to call them in the right way.

Maybe someone knows this issue?

Cheers, Gudrun

MODX3 - PHP 8.2 - Image+ 2.9.4 - pthumb
image+ in a getResource all with the described way from the documentation website of the extra.

Internally Image+ just calls pThumb to generate the cropped images and provides the cropping parameters (e.g. sx=20&sy=30&sw=400&sh=300).

The images are stored in the normal pThumb cache directory (assets/components/phpthumbof/cache by default.)

I don’t know why this doesn’t seem to work in your case.

When you call pThumb manually like this

[[pthumb? &input=`assets/images/someimage.jpg` &options=`sx=20&sy=30&sw=400&sh=300`]]

(with the path to an existing image and some random crop settings), does this work?

1 Like

Thank you very much.

The manually call - for example - [pthumb? &input=assets/images/someimage.jpg &options=sx=20&sy=30&sw=400&sh=300]]
in a resource with a defined image just shows the path, but not the image itself.

The call of the chunk in my getResource chunk is
And the image template “IntroImg” with the aspect ratio for the image is ok, for example w300&h200. But the image within is the full size image.
IntroImg= img src=“[[+source.src:pthumb=w=300&h=200]]”

I deinstalled the extras of pthumb and image+. Cleared all the cache - core and the image caches.

I installed first pthumb and than image+. In a fresh resource I choose a picture from the source where my blogpost pictures are stored.

The cropping in the TV looks fine - but in the cache directory of pThumb there is only high compressed version of the original image without the cropping.

I’m pretty sure, if you want to output the cropped image, you have to also include the placeholder crop.options in your template chunk:

<img src="[[+source.src:pthumb=`[[+crop.options]]&w=300&h=200`]]">

It might be easier to use the default template chunk instead (with the property &options):


The TV thumbnails in the manager are created differently, than the output on the front-end.

1 Like

Thanks again. I‘ll try this tomorrow and will be back here after that.

I could not wait untill tomorrow.

And: now, it works !! Thank you so much.

Settings in the TV image+
Output chunk: IntroImg
Thumbnail URL generation: yes

Settings in the getResources chunk:

And in the IntroImg chunk:
img src=“[[+source.src:pthumb=w=300&h=200]]”

The combination of this configuration now works fine.

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