Image Cropping Quality

Hi There,

i am using the image cropping of CB. I really like this feature. But almost every second project/client is complaining about the quality of the images created by the cropping. For example i have an image with 100KB in perfect quality i crop it to the same or any other size and get an image with less quality and an increase of file size.

I know that this is probably the problem of the php library. But is there any way of using something else? I was thinking of coding something to use the service of imageOptim or something. They have really amazing results and the clients love the quality and google the file size.

Is it possible to hook some kind of a plugin to the image-cropping of CB? Any hints where i could start?

Thanks a lot.

If you’re not already using imagick, that would be a good first step to get sorted.

There are also two settings (contentblocks.crop_jpeg_quality, contentblocks.crop_png_compression) but those are set pretty high by default.

Your ImageOptimOnUpload extra could be made to also run on crops by extending it to also respond to OnFileManagerFileCreate and OnFileManagerFileUpdate events, but beyond optimizing the filesize that can’t magically make extra pixels appear if they were removed by the cropping…

Ah thanx a lot. I was hoping that i could maybe hook to an event like “OnImageCropping” and get the cropping-data (x, y, width, height …) and let imageOptim do the cropping.

I already played a lot with the CB-settings.

It is nothing to bad. The clients (mostly agencys are just very picky with the quality) - so i have to check if i can push imageick any further. :slight_smile:

Thanx a lot.

1 Like