Add shellscript for optimization.

This commit is contained in:
kondou 2013-04-13 10:01:13 +02:00
parent 448a390486
commit 1871f43a52
1 changed files with 20 additions and 0 deletions

20
core/img/image-optimization.sh Executable file
View File

@ -0,0 +1,20 @@
#!/bin/bash
function recursive_optimize_images() {
cd $1;
optipng -o6 *.png;
jpegoptim --strip-all *.jpg;
for svg in `ls *.svg`;
do
mv $svg $svg.opttmp;
scour -i $svg.opttmp -o $svg --create-groups --enable-id-stripping --enable-comment-stripping --shorten-ids --remove-metadata;
done;
rm *.opttmp
for dir in `ls -d */`;
do
recursive_optimize_images $dir;
cd ..;
done;
}
recursive_optimize_images ../../