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?


dman’s picture

Project: ImageCache Actions » ImageAPI
Version: 6.x-2.0 » 6.x-1.x-dev
Component: Custom Actions Module » ImageAPI GD

I 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