Skip to content

Commit

Permalink
Restored append_images
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Apr 4, 2020
1 parent 5ef382f commit ea98bb6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/PIL/IcnsImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,9 +325,10 @@ def _save(im, fp, filename):
size_str = ["ic07", "ic08", "ic09", "ic11", "ic12", "ic13", "ic14", "ic10"]
file_size = 0
entries = []
provided_images = {im.width: im for im in im.encoderinfo.get("append_images", [])}
for index, s in enumerate(sizes):
temp = io.BytesIO()
nb = im.resize((s, s))
nb = provided_images[s] if s in provided_images else im.resize((s, s))
nb.save(temp, "png")
file_size += len(temp.getvalue())
entries.append(
Expand Down

0 comments on commit ea98bb6

Please sign in to comment.