Last active
August 29, 2015 13:56
-
-
Save acechase/8870414 to your computer and use it in GitHub Desktop.
optimize all the jpg's for your (rails or other) application
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This assumes you're using OS X, but should work on any linux-based system | |
# These two find commands could be run as part of the asset packaging step... | |
brew install jpegoptim | |
# checkout disk usage before hand | |
du -h -d 1 . | |
# add -n to jpegoptim options to do a dry run | |
find . -name "*.jpg" -exec jpegoptim --strip-all {} \; | |
brew install optipng | |
# use optipng takes a -simulate option for a dry run | |
find . -name "*.png" -exec optipng {} \; | |
# check optimized disk usage | |
du -h -d 1 . | |
# profit! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment