nextcloud/build/image-optimization.sh
Roeland Jago Douma 02b9388fc6
Move image-optimization.sh to build dir
* We should not ship this!

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2017-07-24 08:08:18 +02:00

21 regels
474 B
Bash
Executable File

#!/usr/bin/env 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 --strip-xml-prolog --no-line-breaks;
done;
rm *.opttmp
for dir in `ls -d */`;
do
recursive_optimize_images $dir;
cd ..;
done;
}
recursive_optimize_images ../