Skip to content

Fixed saving multiple 1 mode frames to GIF#7181

Merged
hugovk merged 1 commit intopython-pillow:mainfrom
radarhere:gif
Jun 6, 2023
Merged

Fixed saving multiple 1 mode frames to GIF#7181
hugovk merged 1 commit intopython-pillow:mainfrom
radarhere:gif

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