From 02b9388fc66568acbcb0381deb11cb21ba8380a6 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Mon, 24 Jul 2017 08:08:18 +0200 Subject: Move image-optimization.sh to build dir * We should not ship this! Signed-off-by: Roeland Jago Douma --- build/image-optimization.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 build/image-optimization.sh (limited to 'build') diff --git a/build/image-optimization.sh b/build/image-optimization.sh new file mode 100755 index 00000000000..cf82e120dcd --- /dev/null +++ b/build/image-optimization.sh @@ -0,0 +1,20 @@ +#!/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 ../ -- cgit v1.2.3