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

Corrected BMP and TGA palette size when saving #6500

Merged
merged 3 commits into from Sep 16, 2022

Conversation

radarhere
Copy link
Member

@radarhere radarhere commented Aug 13, 2022

Resolves #6494
Resolves #6572

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

That meant that when saving BMP and TGA images, the palette might be smaller than 256 colors. However, the plugins always specify the length of the palette as 256 for P images.

This PR changes them to match the length of the palette.

Copy link

@CTimmerman CTimmerman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update: nm, missed a line on manual patch. ^^;

Copy link

@CTimmerman CTimmerman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@radarhere radarhere changed the title Corrected TGA palette size when saving Corrected BMP and TGA palette size when saving Sep 14, 2022
@hugovk hugovk merged commit 50e0c85 into python-pillow:main Sep 16, 2022
59 of 60 checks passed
@radarhere radarhere deleted the tga branch September 16, 2022 13:31
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.

Invalid 8-bit BMP files written when not all palette colours are used P mode TGA writing broke in 9.1.0
3 participants