We have a post that has nine 8MB photos. When we edit it multiple times I believe it optimizes the images every time. I wonder if it is possible to prevent the optimization if the image hasn't changed?

Comments

albertski created an issue. See original summary.

steven jones’s picture

Version: 7.x-1.x-dev » 8.x-2.x-dev

Tricky!

I suppose we could do something like hash the image with sha1 and if we're tried to optimise it before, don't bother.

This could easily be made into a DB table, with a report of previous optimisations etc.

Moving to the latest version of the module for implementation.

steven jones’s picture

Version: 8.x-2.x-dev » 7.x-1.x-dev

This would only work for lossless optimizations I suppose.

Keep a list of hashes of results of files recently optimized and if its seen again, skip lossless optimization.

I'm going to push this back into the 7.x-1.x branch as the X-x-2.x work very differently now, and allow for much finer control of when images are optimized: in those branches it's highly unlikely to re-apply optimizations.