diff options
author | kondou <kondou@ts.unde.re> | 2013-04-13 10:01:13 +0200 |
---|---|---|
committer | kondou <kondou@ts.unde.re> | 2013-04-13 10:40:46 +0200 |
commit | 1871f43a521c54ae9ceeeb2dc3169eb82e765c2e (patch) | |
tree | 4f78cc4e3887d1926a18279ee3a145c9e41a4706 /core/img/image-optimization.sh | |
parent | 448a3904860412c8277718673bc18773990c4c24 (diff) | |
download | nextcloud-server-1871f43a521c54ae9ceeeb2dc3169eb82e765c2e.tar.gz nextcloud-server-1871f43a521c54ae9ceeeb2dc3169eb82e765c2e.zip |
Add shellscript for optimization.
Diffstat (limited to 'core/img/image-optimization.sh')
-rwxr-xr-x | core/img/image-optimization.sh | 20 |
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 ../../ |