| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 # Copyright (c) 2010 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 ALL_DIRS=" | 6 ALL_DIRS=" |
| 7 ash/resources | 7 ash/resources |
| 8 ui/resources | 8 ui/resources |
| 9 chrome/app/theme | 9 chrome/app/theme |
| 10 chrome/browser/resources | 10 chrome/browser/resources |
| 11 chrome/renderer/resources | 11 chrome/renderer/resources |
| 12 webkit/glue/resources | 12 webkit/glue/resources |
| 13 remoting/resources | 13 remoting/resources |
| 14 remoting/webapp | 14 remoting/webapp |
| 15 " | 15 " |
| 16 | 16 |
| 17 function sanitize_file { | 17 function sanitize_file { |
| 18 tput el | 18 tput el |
| 19 echo -ne "$1\r" | 19 echo -ne "$1\r" |
| 20 local file=$1 | 20 local file=$1 |
| 21 local name=$(basename $file) | 21 local name=$(basename $file) |
| 22 pngcrush -d $TMP_DIR -brute -reduce -rem text -rem mkBT \ | 22 # -rem alla removes all ancillary chunks except for tRNS |
| 23 -rem mkTS $file > /dev/null | 23 pngcrush -d $TMP_DIR -brute -reduce -rem alla $file > /dev/null |
| 24 |
| 24 mv "$TMP_DIR/$name" "$file" | 25 mv "$TMP_DIR/$name" "$file" |
| 25 } | 26 } |
| 26 | 27 |
| 27 function sanitize_dir { | 28 function sanitize_dir { |
| 28 local dir=$1 | 29 local dir=$1 |
| 29 for f in $(find $dir -name "*.png"); do | 30 for f in $(find $dir -name "*.png"); do |
| 30 sanitize_file $f | 31 sanitize_file $f |
| 31 done | 32 done |
| 32 } | 33 } |
| 33 | 34 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 53 # If no arguments passed, sanitize all directories. | 54 # If no arguments passed, sanitize all directories. |
| 54 DIRS=$* | 55 DIRS=$* |
| 55 set ${DIRS:=$ALL_DIRS} | 56 set ${DIRS:=$ALL_DIRS} |
| 56 | 57 |
| 57 for d in $DIRS; do | 58 for d in $DIRS; do |
| 58 echo "Sanitizing png files in $d" | 59 echo "Sanitizing png files in $d" |
| 59 sanitize_dir $d | 60 sanitize_dir $d |
| 60 echo | 61 echo |
| 61 done | 62 done |
| 62 | 63 |
| OLD | NEW |