Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm using the "Change File Format" action to reduce the file size of images that are pngs. I want to change the jpeg compression level as well, but without affecting all the other images on the site.
Is there a way to define a custom action or modifying this "Change File Format" action to allow for a custom jpeg compression quality to be set? I may be able to integrate this myself if anyone can suggest some directions for this?
Comments
Comment #1
dman CreditAttribution: dman commentedI just wish we could make PNGs smaller #200817: Modify the existing image.module thumbnailing process to better optimize resized PNG images
This is a little beyond imagecache_actions, as it doesn't actually save images. imageapi does that at the end, and there is no (current) way of sending extra parameters through to that.
If there were a utility, I'd imagine we could add a parameter to the $image meta object that gets passed around, and hopefully when the image is saved that quality parameter could be used. imageapi_gd_image_close() is where it's at.
Nothing I do in the middle of the pipeline will effect the compression used at the end. It's a sane feature request for imageapi, so bounce it over there for consideration.
See also http://drupal.org/project/imageapi_optimize