processwire / processwire-requests

ProcessWire feature requests.
39 stars 0 forks source link

Add hookable imSaveReady() method to ImageSizerEngineIMagick, same as exists in ImageSizerEngineGD #506

Closed Toutouwai closed 5 months ago

Toutouwai commented 8 months ago

Short description of the enhancement

The hookable ImageSizerEngineGD::imSaveReady() method provides access to a resized image before compression is applied. This is useful if a module or any outside code wants to create a matching image file in a different file format and you don't want to double-up any compression artifacts. Indeed, this method is used by the core to create webp files during image resizing for just this reason.

The webp creation in ImageSizerEngineIMagick does not take the same approach and there is no hookable method that would allow a module access to the resized but not-yet-compressed image data. This request is for such a hookable method to be added so that both GD and ImageMagick sizer engines can be equally supported.

Toutouwai commented 7 months ago

I created a PR for this: https://github.com/processwire/processwire/pull/278

ryancramerdesign commented 5 months ago

This has been added, thanks @Toutouwai

Toutouwai commented 5 months ago

Thanks!