summaryrefslogtreecommitdiffstats
path: root/build/image-optimization.sh
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2017-07-24 08:08:18 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2017-07-24 08:08:18 +0200
commit02b9388fc66568acbcb0381deb11cb21ba8380a6 (patch)
tree1b061b829c0398373b8150138c625f25d25d436d /build/image-optimization.sh
parent989614f9d5faa11157b232785537eb5cca927649 (diff)
downloadnextcloud-server-02b9388fc66568acbcb0381deb11cb21ba8380a6.tar.gz
nextcloud-server-02b9388fc66568acbcb0381deb11cb21ba8380a6.zip
Move image-optimization.sh to build dir
* We should not ship this! Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'build/image-optimization.sh')
-rwxr-xr-xbuild/image-optimization.sh20
1 files changed, 20 insertions, 0 deletions
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 ../