Chromium Code Reviews| 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 pngcrush -d $TMP_DIR -brute -reduce -rem text -rem mkBT \ |
| 23 -rem mkTS $file > /dev/null | 23 -rem mkTS -rem iTXt -rem tEXt -rem zTXt -rem tIME \ |
|
Nico
2013/01/12 02:59:24
Looking through the pngcrush souce, it looks like
| |
| 24 $file > /dev/null | |
| 25 | |
| 24 mv "$TMP_DIR/$name" "$file" | 26 mv "$TMP_DIR/$name" "$file" |
| 25 } | 27 } |
| 26 | 28 |
| 27 function sanitize_dir { | 29 function sanitize_dir { |
| 28 local dir=$1 | 30 local dir=$1 |
| 29 for f in $(find $dir -name "*.png"); do | 31 for f in $(find $dir -name "*.png"); do |
| 30 sanitize_file $f | 32 sanitize_file $f |
| 31 done | 33 done |
| 32 } | 34 } |
| 33 | 35 |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 53 # If no arguments passed, sanitize all directories. | 55 # If no arguments passed, sanitize all directories. |
| 54 DIRS=$* | 56 DIRS=$* |
| 55 set ${DIRS:=$ALL_DIRS} | 57 set ${DIRS:=$ALL_DIRS} |
| 56 | 58 |
| 57 for d in $DIRS; do | 59 for d in $DIRS; do |
| 58 echo "Sanitizing png files in $d" | 60 echo "Sanitizing png files in $d" |
| 59 sanitize_dir $d | 61 sanitize_dir $d |
| 60 echo | 62 echo |
| 61 done | 63 done |
| 62 | 64 |
| OLD | NEW |