Strip ICC color profile data

Fixes #337
This commit is contained in:
DarkPhoenix
2015-07-23 20:32:40 +03:00
parent cd7579a4bf
commit 8c19a956e0
46 changed files with 10 additions and 4 deletions

View File

@@ -209,6 +209,9 @@ def get_icon_file(request):
img.thumbnail(ICON_SIZE, Image.ANTIALIAS)
else:
img = Image.open(fullpath)
# Strip all additional image info (mostly for ICC color
# profiles, see issue #337)
img.info = {}
return img
@@ -235,7 +238,7 @@ if toupdate:
continue
fullname = 'icon{}.png'.format(fname)
fullpath = os.path.join(icons_dir, fullname)
icon.save(fullpath, 'PNG')
icon.save(fullpath, 'png')
if missing:
print(' {} icons are missing in export:'.format(len(missing)))
for fname in sorted(missing):
@@ -251,7 +254,7 @@ if toadd:
continue
fullname = 'icon{}.png'.format(fname)
fullpath = os.path.join(icons_dir, fullname)
icon.save(fullpath, 'PNG')
icon.save(fullpath, 'png')
if missing:
print(' {} icons are missing in export:'.format(len(missing)))
for fname in sorted(missing):

View File

@@ -80,6 +80,9 @@ def get_render(type_id):
if img.size != RENDER_SIZE:
img = crop_image(img)
img.thumbnail(RENDER_SIZE, Image.ANTIALIAS)
# Strip all additional image info (mostly for ICC color
# profiles, see issue #337)
img.info = {}
return img
@@ -99,7 +102,7 @@ if toupdate:
render = get_render(type_id)
fname = '{}.png'.format(type_id)
fullpath = os.path.join(icons_dir, fname)
render.save(fullpath, 'PNG')
render.save(fullpath, 'png')
if missing:
print(' {} renders are missing in export:'.format(len(missing)))
for type_id in sorted(missing):
@@ -113,7 +116,7 @@ if toadd:
render = get_render(type_id)
fname = '{}.png'.format(type_id)
fullpath = os.path.join(icons_dir, fname)
render.save(fullpath, 'PNG')
render.save(fullpath, 'png')
if missing:
print(' {} renders are missing in export:'.format(len(missing)))
for type_id in sorted(missing):