diff options
author | Grant Paul <chpwn@chpwn.com> | 2011-01-04 23:31:15 -0800 |
---|---|---|
committer | Grant Paul <chpwn@chpwn.com> | 2011-01-04 23:31:15 -0800 |
commit | 94511d30a0d4f173055292e80d156d8e58da2716 (patch) | |
tree | a3d1791e8f2720c8ae7aed09c00d9b1cdcfd4ef8 /pngcrush.sh | |
parent | f6e1356137e494e0746becbfda851c8858de1c98 (diff) | |
parent | 9c8730d27cb4ca97a5034de527be90c975144c5e (diff) |
Merge branch 'master' of saurik.com:cydia into url-tabbar
Diffstat (limited to 'pngcrush.sh')
-rwxr-xr-x | pngcrush.sh | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/pngcrush.sh b/pngcrush.sh new file mode 100755 index 0000000..69715fb --- /dev/null +++ b/pngcrush.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +png=$1 +steps=() + +function step() { + "$@" + mv -f {_,}_.png + steps+=($(stat -f "%z" _.png)) +} + +pngcrush=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/pngcrush + +grep CgBI "${png}" &>/dev/null && exit 0 + +step cp -fa "${png}" __.png + +#step "${pngcrush}" -q -rem alla -reduce -brute -iphone {,_}_.png + +#step "${pngcrush}" -q -rem alla -reduce -brute {,_}_.png +#step pincrush {,_}_.png + +step "${pngcrush}" -q -rem alla -reduce -iphone {,_}_.png + +#"${pngcrush}" -q -rem alla -reduce -brute -iphone "${png}" 1.png +#"${pngcrush}" -q -iphone _.png 2.png +#ls -la 1.png 2.png + +mv -f _.png "${png}" + +echo -n "${png##*/} " +for ((i = 0; i != ${#steps[@]}; ++i)); do + if [[ $i != 0 ]]; then + echo -n " " + fi + + echo -n "${steps[i]}" +done + +printf $' %.0f%%\n' "$((steps[${#steps[@]}-1] * 100 / steps[0]))" |