summaryrefslogtreecommitdiff
path: root/iencode.sh
diff options
context:
space:
mode:
authorAlex Xu <alex_y_xu@yahoo.ca>2013-08-17 22:22:38 -0400
committerAlex Xu <alex_y_xu@yahoo.ca>2013-08-17 22:22:38 -0400
commit780226fa442abda5cb5b1018e998f50e7985e908 (patch)
tree353b00372e2137e72236c5665293133114208277 /iencode.sh
parent11d9810801baa3e9627e99f0a58ef0eedaeb5bae (diff)
downloadhtml5ks-780226fa442abda5cb5b1018e998f50e7985e908.tar.xz
html5ks-780226fa442abda5cb5b1018e998f50e7985e908.zip
toolchain improvements
Diffstat (limited to 'iencode.sh')
-rwxr-xr-xiencode.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/iencode.sh b/iencode.sh
new file mode 100755
index 0000000..8e2fa81
--- /dev/null
+++ b/iencode.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+# configure cwebp location if not in PATH
+CWEBP=cwebp
+# configure flags
+CWEBP_FLAGS="-m 6"
+
+cd $(dirname $0)/www/dump
+
+iencode() {
+ EXT="$1"
+ QUAL="$2"
+ export EXT QUAL CWEBP CWEBP_FLAGS
+ set -x
+ find . -name \*."${EXT}" -print0 | xargs -0 -n 1 bash -c '
+ IN="$0"
+ OUT="${IN%.${EXT}}.webp"
+ ${CWEBP} -q "${QUAL}" ${CWEBP_FLAGS} ${IN} -o ${OUT}
+ '
+}
+
+iencode jpg 90
+iencode png 99