Created
August 9, 2012 17:00
-
-
Save hjerpbakk/3305910 to your computer and use it in GitHub Desktop.
Script to be used as an OS X service that optimizes .svg-files using the scour Python script From http://hjerpbakk.com/blog/2012/9/1/optimize-svg-images-for-retina-displays.html
This file contains hidden or 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
for f in "$@" | |
do | |
if [ ${f: -4} == ".svg" -o ${f: -4} == ".SVG" ] | |
then | |
python /Applications/Utilities/scour/scour.py --enable-comment-stripping --create-groups --enable-id-stripping --shorten-ids --set-precision=5 --quiet --indent=none -i "$f" -o "$f 2" | |
mv "$f 2" "$f" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment