Skip to content

Netscape GIF extension belongs after the global color table#6211

Merged
hugovk merged 2 commits intopython-pillow:mainfrom
radarhere:gif_loop
May 27, 2022
Merged

Netscape GIF extension belongs after the global color table#6211
hugovk merged 2 commits intopython-pillow:mainfrom
radarhere:gif_loop

Conversation

@radarhere
Copy link
Copy Markdown
Member

Helps #6207

When Pillow saves a GIF at the moment, the number of loops is specified as part of the local header for each frame.

It turns out this is incorrect.

https://web.archive.org/web/20140830100320/http://odur.let.rug.nl/~kleiweg/gif/netscape.html

The Netscape block must appear immediately after the global color table of the logical screen descriptor.

So this PR moves it after the global color table when saving. I've also switched to only reading the number of loops from the first frame, instead of allowing it to potentially change with each frame.

@hugovk hugovk merged commit 69f1b4a into python-pillow:main May 27, 2022
@radarhere radarhere deleted the gif_loop branch May 27, 2022 08:55
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.

2 participants