aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2016-06-29 13:28:57 -0700
committerGerald Combs <gerald@wireshark.org>2016-06-30 15:41:32 +0000
commit9ed7568f700dcd7badf9b272968988c3df671675 (patch)
treed9b9133f4d9e2a3ac78b5c2b2627f54afa34f43b /tools
parenta16d401b25c85ffb7fde6c46b51cb7048112f885 (diff)
Recompress PNGs.
Recompress PNGs using the current versions of various compressors: optipng 0.7.6 advpng 1.20 advdef 1.20 pngcrush 1.8.1 Parallelize PNG compression. Note why we're not using a couple of other compression utilities. Change-Id: I52757d0bc2d424013e7f00b693a0f5378427cc31 Reviewed-on: https://code.wireshark.org/review/16209 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/compress-pngs.sh36
1 files changed, 29 insertions, 7 deletions
diff --git a/tools/compress-pngs.sh b/tools/compress-pngs.sh
index ea93f3d753..c70456e569 100755
--- a/tools/compress-pngs.sh
+++ b/tools/compress-pngs.sh
@@ -28,10 +28,32 @@ if [ -n "$1" ] ; then
FILE_LIST_CMD="echo $1"
fi
-bash -c "$FILE_LIST_CMD" | while read PNG_FILE ; do
- echo Compressing $PNG_FILE
- hash optipng 2>/dev/null && optipng -o3 -quiet "$PNG_FILE"
- hash advpng 2>/dev/null && advpng -z -4 "$PNG_FILE"
- hash advdef 2>/dev/null && advdef -z -4 "$PNG_FILE"
- hash pngcrush 2>/dev/null && pngcrush -q -ow -brute "$PNG_FILE"
-done
+# Other utilities:
+# PNGOUT (http://advsys.net/ken/utils.htm). Closed source.
+# pngquant (https://pngquant.org/). Lossy.
+
+JOBS=8
+export FILE_LIST_CMD
+(
+ echo -n "PNG_FILES ="
+ bash -c "$FILE_LIST_CMD" | while read PNG_FILE ; do
+ echo -e " \\"
+ echo -e -n "\t${PNG_FILE}"
+
+ done
+ cat <<"FIN"
+
+
+all: $(PNG_FILES)
+
+$(PNG_FILES): FORCE
+ @echo Compressing $@
+ @hash optipng 2>/dev/null && optipng -o3 -quiet "$@"
+ @hash advpng 2>/dev/null && advpng -z -4 "$@"
+ @hash advdef 2>/dev/null && advdef -z -4 "$@"
+ @hash pngcrush 2>/dev/null && pngcrush -q -ow -brute -reduce -noforce "$@" pngout.$$$$.png
+
+FORCE:
+FIN
+
+) | make -j $JOBS -f -