Imageoptim unnecessarily re-optimizing the same images during build process. Anybody solved this?

Hi,

with imageoptim enabled it seems that every time a build runs middleman will find that the images in the source directory are different than the one in the build directory and copy them over. This makes sense as the ones in the build directory have been compressed and are therefore different.

Unfortunately this does mean that when it comes to running the imageoptim extension the same images will be compressed again. On a modern mbp this still takes a fair amount of time and with frequent rebuilds is becoming a major pain.

Has anybody solved this problem before?

We sort of hacked around by copying the images over from the build dir back to source dir after a build, but I’m not sure I like it that much.

thanks

I have the same problem. This also make the commits uploaded for github pages much bigger. :frowning:

fwiw, since I couldn’t get a response and didn’t have the time to implement this, I eventually worked around it leveraging the branching I already had in place.

I have a branch for testing and one for production so I just disabled the plugin in all branches but production which works out for me.
hope it helps,