Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: packagerChrome.py

Issue 29501558: Issue 5383 - Add tests for the Chrome and Firefox packagers (Closed)
Patch Set: Readme, difflib, buildnum Created Sept. 13, 2017, 1:29 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « README.md ('k') | tests/README.md » ('j') | tests/metadata.gecko » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packagerChrome.py
diff --git a/packagerChrome.py b/packagerChrome.py
index d75203d17b9e63262e69f44e5112cfc729005d8d..bf6f5f962f3c75b270e25d2438856ff2ed095ff3 100644
--- a/packagerChrome.py
+++ b/packagerChrome.py
@@ -43,13 +43,9 @@ def processFile(path, data, params):
def makeIcons(files, filenames):
- try:
- from PIL import Image
- except ImportError:
- import Image
icons = {}
for filename in filenames:
- width, height = Image.open(StringIO(files[filename])).size
+ width, height = struct.unpack('>ii', files[filename][16:24])
Sebastian Noack 2017/09/13 19:18:29 I wonder whether it would be worth to check for th
tlucas 2017/09/14 09:39:53 Do we strictly require the icons to be pngs? If ye
Sebastian Noack 2017/09/14 16:51:59 We only use PNG. But technically, some other forma
if(width != height):
print >>sys.stderr, 'Warning: %s size is %ix%i, icon should be square' % (filename, width, height)
icons[width] = filename
« no previous file with comments | « README.md ('k') | tests/README.md » ('j') | tests/metadata.gecko » ('J')

Powered by Google App Engine
This is Rietveld