This is going to be a very short one – I’m really too busy right now to spend time on doing a proper blog post. I hope I’ll manage to do an update soon.
I’ve just spent two hours creating an image optimization module that’s just submitted to Sitecore Marketplace. It will run pngcrush, jpegtran, or whatever image compression utility you prefer on your images in media library.
Since I shouldn’t redistribute pngcrush/jpegtran, you’d have to download those two exe files yourself and put them in a suitable location on your server. Just update the config file with the location of those files and you may also fiddle with the command line arguments to suit your needs.
Once installed, a Compress menu option will appear in the media ribbon. It will only be active for png and jpg images. Clicking compress will start the compression job.
The original file will be backed up into your configured backup folder. On a successful compression, i.e. the resulting file is smaller; the new file will be attached to the media item.
In the future, I’d like to do the same processing for resized images as well.
Using this tool, the Android simulator background image that comes with a clean Sitecore setup, was shrinked from 112278 to 71138 bytes. That’s a reduction of almost 37% without any loss in image quality.
Download Image Optimizer-0.1.zip package.
Hope you like it!