server/core/img/image-optimization.sh
kondou 90f351afa2 Optimize some images
and strip metadata from png images with optipng in image_optimization.sh
2014-02-19 21:31:50 +01:00

20 lines
433 B
Bash
Executable file

#!/bin/bash
function recursive_optimize_images() {
cd $1;
optipng -o6 -strip all *.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 ../../