Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle unexpected ICO image sizes #3836

Merged
merged 1 commit into from May 12, 2019
Merged

Conversation

radarhere
Copy link
Member

Resolves #3834

The issue has an ICO file that says that it is 32x64. However, once the image is loaded, it is found to only be 32x32. This PR stops Pillow from raising ValueError: This is not one of the allowed sizes of this image. Instead, the new size is accepted, and the size of the subimage is updated in info['sizes']. To alert the user to this unexpected behaviour, a warning is raised, 'Image was not the expected size'.

The idea of updating to the loaded image size actually already exists in the code -

self.size = im.size

@hugovk hugovk merged commit feb413e into python-pillow:master May 12, 2019
@radarhere radarhere deleted the ico_size branch May 12, 2019 19:18
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.

Issue opening a .ico file
2 participants