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

Fixed saving multiple 1 mode frames to GIF #7181

Merged
merged 1 commit into from
Jun 6, 2023
Merged

Conversation

radarhere
Copy link
Member

Updates GifImagePlugin so that

def _get_palette_bytes(im):
"""
Gets the palette for inclusion in the gif header
:param im: Image object
:returns: Bytes, len<=768 suitable for inclusion in gif header
"""
return im.palette.palette

returns an empty bytestring if there is no palette.

The test case I've added otherwise fails with AttributeError: 'NoneType' object has no attribute 'palette' in the above function.

@radarhere radarhere added the GIF label May 23, 2023
@radarhere radarhere changed the title Fixed saving multiple 1 mode images to GIF Fixed saving multiple 1 mode frames to GIF May 24, 2023
@hugovk hugovk merged commit df873e3 into python-pillow:main Jun 6, 2023
@radarhere radarhere deleted the gif branch June 6, 2023 07:53
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