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 ImageOps expand with tuple border on P image #5615

Merged
merged 1 commit into from Jul 26, 2021

Conversation

radarhere
Copy link
Member

@radarhere radarhere commented Jul 16, 2021

b6b362c changed expand() so that for a P image in ImageOps.expand(), the border color is only filled after attaching the palette.

Instead, this PR create a copy of the palette (to avoid modifying the original), calculates the new palette index from that, and then sets the new palette index as the background of the image.

This brings the logic for P and non-P images in ImageOps.expand() closer together, and resolves #5614 in the process. In that issue, drawing a single rectangle wasn't able to accomodate a multiple border widths being passed in a tuple. This PR removes the rectangle drawing altogether, fixing that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ImageOps.expand error with tuple border
2 participants