server/build/image-optimization.sh

21 lines
475 B
Bash
Raw Permalink Normal View History

2015-09-27 11:03:31 +00:00
#!/usr/bin/env bash
2013-04-13 08:01:13 +00:00
function recursive_optimize_images() {
cd $1;
optipng -o6 -strip all *.png;
2013-04-13 08:01:13 +00:00
jpegoptim --strip-all *.jpg;
for svg in `ls *.svg`;
do
mv $svg $svg.opttmp;
scour --create-groups --enable-id-stripping --enable-comment-stripping --shorten-ids --remove-metadata --strip-xml-prolog --no-line-breaks -i $svg.opttmp -o $svg;
2013-04-13 08:01:13 +00:00
done;
rm *.opttmp
for dir in `ls -d */`;
do
recursive_optimize_images $dir;
cd ..;
done;
}
recursive_optimize_images ../