Skip to content

Commit 3507992

Browse files
author
MarcoFalke
committed
[trivial] Make optimize-pngs.py also cover share/pixmaps
Also fix: "Exception: tostring() has been removed. Please call tobytes() instead."
1 parent 8a320c7 commit 3507992

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

contrib/devtools/optimize-pngs.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python
22
'''
3-
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).
3+
Run this script 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).
44
#pngcrush -brute -ow -rem gAMA -rem cHRM -rem iCCP -rem sRGB -rem alla -rem text
55
'''
66
import os
@@ -18,12 +18,12 @@ def content_hash(filename):
1818
'''Return hash of RGBA contents of image'''
1919
i = Image.open(filename)
2020
i = i.convert('RGBA')
21-
data = i.tostring()
21+
data = i.tobytes()
2222
return hashlib.sha256(data).hexdigest()
2323

2424
pngcrush = 'pngcrush'
2525
git = 'git'
26-
folders = ["src/qt/res/movies", "src/qt/res/icons"]
26+
folders = ["src/qt/res/movies", "src/qt/res/icons", "share/pixmaps"]
2727
basePath = subprocess.check_output([git, 'rev-parse', '--show-toplevel']).rstrip('\n')
2828
totalSaveBytes = 0
2929
noHashChange = True

0 commit comments

Comments
 (0)