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

Pad IM palette to 768 bytes when saving #6579

Merged
merged 1 commit into from
Oct 11, 2022
Merged

Conversation

radarhere
Copy link
Member

#6060 contained a commit entitled "Allow getpalette() to return less than 256 colors"

This meant that there were fewer bytes when saving in IM.

fp.write(im.im.getpalette("RGB", "RGB;L")) # 768 bytes

But IM still expected 768 bytes when reading.

palette = self.fp.read(768)

So this PR pads the palette to 768 bytes when saving.

@hugovk hugovk merged commit 5076d34 into python-pillow:main Oct 11, 2022
@radarhere radarhere deleted the im branch October 11, 2022 20:57
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