Skip to content

If ICO image is smaller than (16, 16), save original size by default#9766

Open
radarhere wants to merge 2 commits into
python-pillow:mainfrom
radarhere:ico_size
Open

If ICO image is smaller than (16, 16), save original size by default#9766
radarhere wants to merge 2 commits into
python-pillow:mainfrom
radarhere:ico_size

Conversation

@radarhere

Copy link
Copy Markdown
Member

Alternative to #9745

https://pillow.readthedocs.io/en/stable/handbook/image-file-formats.html#ico-saving

sizes
A list of sizes included in this ico file; these are a 2-tuple, (width, height); Default to [(16, 16), (24, 24), (32, 32), (48, 48), (64, 64), (128, 128), (256, 256)]. Any sizes bigger than the original size or 256 will be ignored.

If all sizes are ignored, then the file is still allowed to be saved at the moment, just without any visual content.

This PR updates the default behaviour to use the image size if it is smaller than (16, 16) in either dimension. If the user explicitly requested 'sizes', then raise a ValueError if all sizes were ignored.

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.

1 participant