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