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

Added test #1

Merged

Conversation

radarhere
Copy link

Suggestion for python-pillow#6377

While you've updated the existing tests, none of the tests spell out the need for this change. I've taken your example code and adapted it into a test, to ensure that your change won't be easily reverted in the future.

Copy link
Owner

@btrekkie btrekkie left a comment

Choose a reason for hiding this comment

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

Thanks, just one minor comment.

palette.putpalette(data)
quantized = im.quantize(dither=Image.Dither.NONE, palette=palette)

assert tuple(p for p in quantized.palette.palette) == data
Copy link
Owner

Choose a reason for hiding this comment

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

This can be simplified to assert tuple(quantized.palette.palette) == data.

Copy link
Author

Choose a reason for hiding this comment

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

You're right, I've updated the commit.

@btrekkie btrekkie merged commit b7dc310 into btrekkie:fix-round-to-palette Jun 20, 2022
@radarhere radarhere deleted the fix-round-to-palette-tests branch June 20, 2022 02:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants