]> de.git.xonotic.org Git - xonotic/xonotic.wiki.git/blobdiff - assets/imagecrush.sh
include old redmine-hosted files
[xonotic/xonotic.wiki.git] / assets / imagecrush.sh
diff --git a/assets/imagecrush.sh b/assets/imagecrush.sh
new file mode 100755 (executable)
index 0000000..0068880
--- /dev/null
@@ -0,0 +1,29 @@
+#!/bin/sh
+# optimizing binary file size
+
+SRC_DIR="images-prep"
+DST_DIR="images"
+OLD_DIR="images-old"
+
+
+SELF=`basename $0`;
+if ! [ -f ./$SELF ]; then
+       echo "Cannot find myself."
+       exit 1
+fi
+d=`pwd`
+SELF="$d/$SELF"
+cd $d
+
+mkdir -p ${OLD_DIR}
+
+cd ${SRC_DIR}
+for image in `ls *.png`; do
+       pngcrush -oldtimestamp ${image} $d/${DST_DIR}/${image} #|| echo "error processing $image - fix it" && exit 1
+       mv ${image} $d/${OLD_DIR}/${image}
+done
+for image in `ls *.jp*g`; do
+       jpegoptim --preserve -d $d/${DST_DIR}/ ${image} #|| echo "error processing $image - fix it" && exit 1
+       mv ${image} $d/${OLD_DIR}/${image}
+done
+cd $d