Skip to content

Conversation

@radarhere
Copy link
Member

Resolves #4943

For the broken image from that issue, the Global Color Table Flag isn't set. Without it, https://www.w3.org/Graphics/GIF/spec-gif89a.txt

No Global Color Table follows, the Background Color Index field is meaningless.

And yet, the disposal method is 2, 'Restore to background color'. So, we need to restore to the background color without knowing what that background color is.

I feel like this is a gap in the specification. If we treat the missing background color as zero though, the image loads correctly. That seems like a better option than our current behaviour of catching the error and just continuing on with the last good disposal that we had.

I presume this missing background color was the KeyError being caught, so I've removed that.

@radarhere radarhere added the GIF label Apr 7, 2021
@hugovk hugovk merged commit 2f5687f into python-pillow:master Apr 15, 2021
@radarhere radarhere deleted the gif_missing_background branch April 15, 2021 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GIF not loading correctly

2 participants