From 789a227a635b13b782a38f0a38bcb35b099f12d8 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Thu, 26 Apr 2018 14:42:35 +0000 Subject: Optionally optimize PNGs with optipng in make_expected.sh. Change-Id: I10b1844052431fdb25d028eac39f45f481f32ba1 Reviewed-on: https://pdfium-review.googlesource.com/31351 Reviewed-by: Ryan Harrison Commit-Queue: Ryan Harrison --- testing/tools/make_expected.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'testing/tools') diff --git a/testing/tools/make_expected.sh b/testing/tools/make_expected.sh index 3d4252f0d3..793c3f5b66 100755 --- a/testing/tools/make_expected.sh +++ b/testing/tools/make_expected.sh @@ -5,7 +5,10 @@ # found in the LICENSE file. # # Script to generate expected result files. -# + +# Do this before "set -e" so "which" failing is not fatal. +PNGOPTIMIZER="$(which optipng)" + set -e while (( "$#" )); do INFILE="$1" @@ -15,6 +18,9 @@ while (( "$#" )); do for RESULT in $RESULTS ; do EXPECTED=`echo -n $RESULT | sed 's/[.]pdf[.]/_expected.pdf./'` mv $RESULT $EXPECTED + if [ -n "$PNGOPTIMIZER" ]; then + "$PNGOPTIMIZER" $EXPECTED + fi done shift done -- cgit v1.2.3