summaryrefslogtreecommitdiffstats
path: root/core/img/image-optimization.sh
diff options
context:
space:
mode:
authorkondou <kondou@ts.unde.re>2013-04-13 10:01:13 +0200
committerkondou <kondou@ts.unde.re>2013-04-13 10:40:46 +0200
commit1871f43a521c54ae9ceeeb2dc3169eb82e765c2e (patch)
tree4f78cc4e3887d1926a18279ee3a145c9e41a4706 /core/img/image-optimization.sh
parent448a3904860412c8277718673bc18773990c4c24 (diff)
downloadnextcloud-server-1871f43a521c54ae9ceeeb2dc3169eb82e765c2e.tar.gz
nextcloud-server-1871f43a521c54ae9ceeeb2dc3169eb82e765c2e.zip
Add shellscript for optimization.
Diffstat (limited to 'core/img/image-optimization.sh')
-rwxr-xr-xcore/img/image-optimization.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/core/img/image-optimization.sh b/core/img/image-optimization.sh
new file mode 100755
index 00000000000..0a96bf558d1
--- /dev/null
+++ b/core/img/image-optimization.sh
@@ -0,0 +1,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 ../../