Skip to content

ICO: Only save relevant sizes#2267

Merged
wiredfool merged 8 commits into
python-pillow:masterfrom
hugovk:only-save-relevant-sizes
Dec 1, 2016
Merged

ICO: Only save relevant sizes#2267
wiredfool merged 8 commits into
python-pillow:masterfrom
hugovk:only-save-relevant-sizes

Conversation

@hugovk

@hugovk hugovk commented Nov 30, 2016

Copy link
Copy Markdown
Member

Fixes #2266.

Includes PR #2265 that fixes #2264.

See the antepenultimate commit for a failing case for this, and the last two commits to fix it.

The return from filter was being ignored.

For width, height = 64, 64 it returns:
[(16, 16), (24, 24), (32, 32), (48, 48), (64, 64)]

For width, height = 256, 256 it returns:
[(16, 16), (24, 24), (32, 32), (48, 48), (64, 64), (128, 128), (256, 256)]


Running the test in #2266 gives:

set([(16, 16), (48, 48), (32, 32)])
set([(16, 16), (24, 24), (48, 48), (32, 32)])
$ identify python.ico
python.ico[0] ICO 16x16 16x16+0+0 32-bit sRGB 15.1KB 0.000u 0:00.002
python.ico[1] ICO 32x32 32x32+0+0 32-bit sRGB 15.1KB 0.016u 0:00.007
python.ico[2] ICO 48x48 48x48+0+0 32-bit sRGB 15.1KB 0.016u 0:00.013
$ identify saved.ico
saved.ico[0] PNG 16x16 16x16+0+0 8-bit sRGB 6.66KB 0.000u 0:00.000
saved.ico[1] PNG 24x24 24x24+0+0 8-bit sRGB 6.66KB 0.000u 0:00.004
saved.ico[2] PNG 32x32 32x32+0+0 8-bit sRGB 6.66KB 0.000u 0:00.007
saved.ico[3] PNG 48x48 48x48+0+0 8-bit sRGB 6.66KB 0.000u 0:00.010

@wiredfool
wiredfool merged commit 0957309 into python-pillow:master Dec 1, 2016
@hugovk
hugovk deleted the only-save-relevant-sizes branch December 1, 2016 19:24
hugovk added a commit that referenced this pull request Sep 5, 2017
Code was fixed in #2267 but not the docs.
@hugovk hugovk mentioned this pull request Sep 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Saving .ico saves more sizes than necessary .ico files are saved as 255x255

2 participants