Skip to content

Commit

Permalink
If primary image is already destination size, do not duplicate
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Mar 11, 2022
1 parent 3900809 commit adbe2bc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/PIL/IcoImagePlugin.py
Expand Up @@ -56,7 +56,9 @@ def _save(im, fp, filename):
fp.write(o16(len(sizes))) # idCount(2)
offset = fp.tell() + len(sizes) * 16
bmp = im.encoderinfo.get("bitmap_format") == "bmp"
provided_images = {im.size: im for im in im.encoderinfo.get("append_images", [])}
provided_images = {
im.size: im for im in [im] + im.encoderinfo.get("append_images", [])
}
for size in sizes:
width, height = size
# 0 means 256
Expand Down

0 comments on commit adbe2bc

Please sign in to comment.