Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(204)

Unified Diff: tools/resources/optimize-png-files.sh

Issue 549553002: Exit if pngcrush has a bug (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/resources/optimize-png-files.sh
diff --git a/tools/resources/optimize-png-files.sh b/tools/resources/optimize-png-files.sh
index d9347ee8122c46f5a030198592e0257135bda799..c7b37d73777cef59d3b2ec44d7983ea115b43946 100755
--- a/tools/resources/optimize-png-files.sh
+++ b/tools/resources/optimize-png-files.sh
@@ -381,6 +381,19 @@ function fail_if_not_installed {
fi
}
+# Check pngcrush version and exit if the version is in bad range.
+# See crbug.com/404893.
+function exit_if_bad_pngcrush_version {
+ local version=$(pngcrush -v | awk "/pngcrush 1.7./ {print \$3}")
+ local version_num=$(echo $version | sed "s/\.//g")
+ if [[ (1748 -lt $version_num && $version_num -lt 1773) ]] ; then
msw 2014/09/05 19:05:43 How did you find this range? I'd like to be sure t
+ echo "Your pngcrush ($version) has a bug that exists from " \
+ "1.7.49 to 1.7.72 (see crbug.com/404893 for details)."
+ echo "Please upgrade pngcrush and try again"
+ exit 1;
+ fi
+}
+
function show_help {
local program=$(basename $0)
echo \
@@ -461,6 +474,8 @@ shift $(($OPTIND -1))
# Make sure we have all necessary commands installed.
install_if_not_installed pngcrush pngcrush
+exit_if_bad_pngcrush_version
+
if [ $OPTIMIZE_LEVEL -ge 1 ]; then
install_if_not_installed optipng optipng
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698