Validate self.palette in has_transparency_data()#7796
Validate self.palette in has_transparency_data()#7796gdesmar wants to merge 1 commit intopython-pillow:mainfrom gdesmar:validate_palette_on_transparency_check
Conversation
|
There are two ways of looking at this.
I had a look through our existing test files, and found this happening with some of our TGA images. I've created #7797 to fix that. Would you be able to upload the images that are causing this for you? |
|
I believe the older version of Pillow was assuming no transparency, but I just tested with VSCode and it looks to think that the icons do have transparency. I would like to point out that I often have to work with corrupted files, so hopefully those won't be too much of a problem.
|
|
Thanks. I've created #7798. That should fix your original error. |
|
Thank you for your detailed explanations and quick fixes. :) |
|
#7798 has now been merged. |
I have a few files that I was able to open and save in Pillow 9.3.0, that result in an error with the newest (10.2.0) version. I believe that the newer has_transparency_data property can cause an error if the palette is not defined from opening a file.
I believe the solution is as simple as that, but feel free to disregard the PR if it needs a more complex fix.