diff options
author | Marco <falke.marco@gmail.com> | 2015-08-04 12:06:12 +0200 |
---|---|---|
committer | Marco <falke.marco@gmail.com> | 2015-08-04 12:06:12 +0200 |
commit | 914286757268b3c0566e4de5bae36809937c4d6f (patch) | |
tree | ad3e2d6080be05f6c224e989e12042a68f7b37d0 /contrib/devtools | |
parent | 86cfd23f68367af072500b1758a4c446cdd36e74 (diff) |
[QT] cleanup icons
* Cleanup SVG code
* Unify design ("Typicons" seem to have round edges)
* Fix transparency issue with clock5.png
Diffstat (limited to 'contrib/devtools')
-rwxr-xr-x | contrib/devtools/optimize-pngs.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/contrib/devtools/optimize-pngs.py b/contrib/devtools/optimize-pngs.py index 38aaa00f31..b6d6a097d6 100755 --- a/contrib/devtools/optimize-pngs.py +++ b/contrib/devtools/optimize-pngs.py @@ -1,5 +1,8 @@ #!/usr/bin/env python - +''' +Run this scrip every time you change one of the png files. Using pngcrush, it will optimize the png files, remove various color profiles, remove ancillary chunks (alla) and text chunks (text). +#pngcrush -brute -ow -rem gAMA -rem cHRM -rem iCCP -rem sRGB -rem alla -rem text +''' import os import sys import subprocess @@ -18,14 +21,12 @@ def content_hash(filename): data = i.tostring() return hashlib.sha256(data).hexdigest() -#optimize png, remove various color profiles, remove ancillary chunks (alla) and text chunks (text) -#pngcrush -brute -ow -rem gAMA -rem cHRM -rem iCCP -rem sRGB -rem alla -rem text - pngcrush = 'pngcrush' git = 'git' -folders = ["src/qt/res/movies", "src/qt/res/icons", "src/qt/res/images"] +folders = ["src/qt/res/movies", "src/qt/res/icons"] basePath = subprocess.check_output([git, 'rev-parse', '--show-toplevel']).rstrip('\n') totalSaveBytes = 0 +noHashChange = True outputArray = [] for folder in folders: @@ -68,6 +69,7 @@ for fileDict in outputArray: oldHash = fileDict['sha256Old'] newHash = fileDict['sha256New'] totalSaveBytes += fileDict['osize'] - fileDict['psize'] + noHashChange = noHashChange and (oldHash == newHash) print fileDict['file']+"\n size diff from: "+str(fileDict['osize'])+" to: "+str(fileDict['psize'])+"\n old sha256: "+oldHash+"\n new sha256: "+newHash+"\n" -print "completed. Total reduction: "+str(totalSaveBytes)+" bytes" +print "completed. Checksum stable: "+str(noHashChange)+". Total reduction: "+str(totalSaveBytes)+" bytes" |