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

Side by Side Diff: tools/resources/optimize-png-files.sh

Issue 486573002: Move webkit resources over to content. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix GN Created 6 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tools/gritsettings/resource_ids ('k') | ui/base/resource/resource_bundle_mac.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/bin/bash -i 1 #!/bin/bash -i
2 # Copyright 2013 The Chromium Authors. All rights reserved. 2 # Copyright 2013 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 # The optimization code is based on pngslim (http://goo.gl/a0XHg) 6 # The optimization code is based on pngslim (http://goo.gl/a0XHg)
7 # and executes a similar pipleline to optimize the png file size. 7 # and executes a similar pipleline to optimize the png file size.
8 # The steps that require pngoptimizercl/pngrewrite/deflopt are omitted, 8 # The steps that require pngoptimizercl/pngrewrite/deflopt are omitted,
9 # but this runs all other processes, including: 9 # but this runs all other processes, including:
10 # 1) various color-dependent optimizations using optipng. 10 # 1) various color-dependent optimizations using optipng.
11 # 2) optimize the number of huffman blocks. 11 # 2) optimize the number of huffman blocks.
12 # 3) randomize the huffman table. 12 # 3) randomize the huffman table.
13 # 4) Further optimize using optipng and advdef (zlib stream). 13 # 4) Further optimize using optipng and advdef (zlib stream).
14 # Due to the step 3), each run may produce slightly different results. 14 # Due to the step 3), each run may produce slightly different results.
15 # 15 #
16 # Note(oshima): In my experiment, advdef didn't reduce much. I'm keeping it 16 # Note(oshima): In my experiment, advdef didn't reduce much. I'm keeping it
17 # for now as it does not take much time to run. 17 # for now as it does not take much time to run.
18 18
19 readonly ALL_DIRS=" 19 readonly ALL_DIRS="
20 ash/resources 20 ash/resources
21 chrome/android/java/res 21 chrome/android/java/res
22 chrome/app/theme 22 chrome/app/theme
23 chrome/browser/resources 23 chrome/browser/resources
24 chrome/renderer/resources 24 chrome/renderer/resources
25 content/public/android/java/res 25 content/public/android/java/res
26 content/app/resources
26 content/renderer/resources 27 content/renderer/resources
27 content/shell/resources 28 content/shell/resources
28 remoting/resources 29 remoting/resources
29 ui/resources 30 ui/resources
30 ui/chromeos/resources 31 ui/chromeos/resources
31 ui/webui/resources/images 32 ui/webui/resources/images
32 webkit/glue/resources
33 win8/metro_driver/resources 33 win8/metro_driver/resources
34 " 34 "
35 35
36 # Files larger than this file size (in bytes) will 36 # Files larger than this file size (in bytes) will
37 # use the optimization parameters tailored for large files. 37 # use the optimization parameters tailored for large files.
38 LARGE_FILE_THRESHOLD=3000 38 LARGE_FILE_THRESHOLD=3000
39 39
40 # Constants used for optimization 40 # Constants used for optimization
41 readonly DEFAULT_MIN_BLOCK_SIZE=128 41 readonly DEFAULT_MIN_BLOCK_SIZE=128
42 readonly DEFAULT_LIMIT_BLOCKS=256 42 readonly DEFAULT_LIMIT_BLOCKS=256
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
523 if [ $PROCESSED_FILE != 0 ]; then 523 if [ $PROCESSED_FILE != 0 ]; then
524 let diff=$TOTAL_OLD_BYTES-$TOTAL_NEW_BYTES 524 let diff=$TOTAL_OLD_BYTES-$TOTAL_NEW_BYTES
525 let percent=$diff*100/$TOTAL_OLD_BYTES 525 let percent=$diff*100/$TOTAL_OLD_BYTES
526 echo "Result: $TOTAL_OLD_BYTES => $TOTAL_NEW_BYTES bytes" \ 526 echo "Result: $TOTAL_OLD_BYTES => $TOTAL_NEW_BYTES bytes" \
527 "($diff bytes: $percent%)" 527 "($diff bytes: $percent%)"
528 fi 528 fi
529 if [ $CORRUPTED_FILE != 0 ]; then 529 if [ $CORRUPTED_FILE != 0 ]; then
530 echo "Warning: corrupted files found: $CORRUPTED_FILE" 530 echo "Warning: corrupted files found: $CORRUPTED_FILE"
531 echo "Please contact the author of the CL that landed corrupted png files" 531 echo "Please contact the author of the CL that landed corrupted png files"
532 fi 532 fi
OLDNEW
« no previous file with comments | « tools/gritsettings/resource_ids ('k') | ui/base/resource/resource_bundle_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698