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
Issue opening a .ico file #3834
Comments
When you say that it worked perfectly in Python 3.6, I imagine that you were using an earlier version of Pillow. This error was introduced in Pillow 5.3.0. I've created PR #3836 to resolve this. |
Oh, interesting, thanks! |
I found this issue and was hoping I would be able to update and get the fix. However, when running my code (same issue as @Jhynjhiruu), I get the following traceback. Appears to be the same error. Below are what I have installed right now. |
This was fixed in #3836, released in Pillow 6.1.0. You're using Pillow 6.0.0, please upgrade :) |
Wow, fast response! Thanks! The screenshot above shows I ran |
You're welcome! You have more than one Python in your system:
|
What did you do?
I tried to open a .ico file from a BytesIO object, to use as the icon for my program.
What did you expect to happen?
The file would be opened successfully and the icon used for the program
What actually happened?
An error was raised, specifically
builtins.ValueError: This is not one of the allowed sizes of this image
What are your OS, Python and Pillow versions?
Please include code that reproduces the issue and whenever possible, an image that demonstrates the issue. Please upload images to GitHub, not to third-party file hosting sites. If necessary, add the image to a zip or tar archive.
The best reproductions are self-contained scripts with minimal dependencies. If you are using a framework such as plone, Django, or buildout, try to replicate the issue just using Pillow.
Weirdly, the exact same code worked perfectly in Python 3.6. Doing some investigating, it appears that here:
self.info['sizes']
is being set incorrectly, because the .ico file is 32x32.The text was updated successfully, but these errors were encountered: