Chromium Code Reviews| 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 |