summaryrefslogtreecommitdiffstats
path: root/core/img/image-optimization.sh
blob: 0a96bf558d1c809c2ffc653a0d8c21c8b583c770 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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 ../../