mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-27 02:16:19 +03:00
Keep user-specified ordering of icon sizes
Some consumers of icon files such as py2exe care about the order that icon sizes are added, so the user should be fully in charge of this, instead of force sorting them.
This commit is contained in:
parent
5be6f810a5
commit
740ab40c6d
|
@ -48,7 +48,6 @@ def _save(im, fp, filename):
|
||||||
width, height = im.size
|
width, height = im.size
|
||||||
filter(lambda x: False if (x[0] > width or x[1] > height or
|
filter(lambda x: False if (x[0] > width or x[1] > height or
|
||||||
x[0] > 255 or x[1] > 255) else True, sizes)
|
x[0] > 255 or x[1] > 255) else True, sizes)
|
||||||
sizes = sorted(sizes, key=lambda x: x[0])
|
|
||||||
fp.write(struct.pack("H", len(sizes))) # idCount(2)
|
fp.write(struct.pack("H", len(sizes))) # idCount(2)
|
||||||
offset = fp.tell() + len(sizes)*16
|
offset = fp.tell() + len(sizes)*16
|
||||||
for size in sizes:
|
for size in sizes:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user