commit suggestion; update src/PIL/IcoImagePlugin.py

Co-Authored-By: Andrew Murray <3112309+radarhere@users.noreply.github.com>
This commit is contained in:
ziplantil 2020-04-20 12:08:41 +03:00 committed by GitHub
parent 39f4738775
commit 4ca8a3507d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -64,9 +64,8 @@ def _save(im, fp, filename):
fp.write(struct.pack("<H", 32)) # wBitCount(2)
image_io = BytesIO()
if size in alt_images:
tmp = alt_images[size]
else:
tmp = alt_images.get(size)
if not tmp:
# TODO: invent a more convenient method for proportional scalings
tmp = im.copy()
tmp.thumbnail(size, Image.LANCZOS, reducing_gap=None)