asciidisco / grunt-imagine

Grunt tasks for optimizing & inlining images
MIT License
153 stars 21 forks source link

JPGs are getting bigger... #2

Closed webgefrickel closed 12 years ago

webgefrickel commented 12 years ago
Running "jpgmin" task
>> Compressed 2 files
>> Uncompressed size: 8.91kb, Compressed size: 9.41kb, Savings: -5.59%

I had some jpg-files in my project folder that where already optimized with http://imageoptim.com/ After running the jpgmin-task (overwriting the files src === dest) I got bigger images.

Both jpegtran and jpegoptim are installed via homebrew, versions are:

jpegtran release 8d of 15-Jan-2012 jpegoptim v1.2.4 Copyright (c) Timo Kokkonen, 1996-2011.

Maybe it is a good idea to check if the resulting images are actually smaller when overwriting files - dunno if that happens.

Everything else is running just smooth, couldn't reproduce this issue with png-files :-) Thanks a lot!

asciidisco commented 12 years ago

Mhh, this issue could probably come up with png & gif files as well. I def. need to add a file size check.

Btw.: If you have any good suggestions for further optim. tools, please check this: https://gist.github.com/3048016

asciidisco commented 12 years ago

Should be fixed with 0.1.3. The original file contents will be stored in memory & if the output file is bigger, the original file will now be restored.

I also added jpegrescan to the mix. If you have jpegtran, jpegoptim & jpegrescan installed, imagine should now produce the exact same file sizes as imageoptim (hopefully).

webgefrickel commented 12 years ago

You, sir, are awesome. Just to confirm: the two test-files I had are now even a whoppin 0.68% smaller than the imageoptim-ones ;-)

asciidisco commented 12 years ago

Thanks :D Yay good to hear that. Btw.: @sindresorhus told me about http://sourceforge.net/projects/libjpeg-turbo/ maybe you wanna try that one to optimize the speed of your build.