Created
February 24, 2013 03:05
-
-
Save fike/5022402 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
# | |
# Simple script to length image optimization. | |
# Fernando Ike - fike@midstorm.org. | |
# | |
# | |
# | |
DIR=$HOME/d/octopress/source/images | |
CONVERT=$(which convert) | |
PNGCRUSH=$(which pngcrush) | |
LS=$(which ls) | |
MV=$(which mv) | |
for i in $($LS $DIR/*.jpg) | |
do | |
$CONVERT -strip -interlace Plane $i $i.new > /dev/null | |
$MV $i.new $i | |
done | |
for i in $(LS $DIR/*.png) | |
do $PNGCRUSH -rem alla -brute -reduce $i $i.new > /dev/null | |
$MV $i.new $i | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment