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

For special image modes, revert default resize resampling to NEAREST #5411

Merged
merged 1 commit into from
Apr 19, 2021

Conversation

radarhere
Copy link
Member

@radarhere radarhere commented Apr 16, 2021

Helps #4402

#4255 changed the default resample argument for resize() to BICUBIC, with the goal of being more user-friendly. However, it turned out to not be more user-friendly for IMAGING_TYPE_SPECIAL modes, where we don't currently support resampling, except for NEAREST - leading to the "image has wrong mode" in the issue.

This PR switches back to NEAREST if the image is IMAGING_TYPE_SPECIAL, so that the default resample value once again works for those modes.

Looking at the code, IMAGING_TYPE_SPECIAL applies to mode with a custom number of bits: a semicolon in their mode.

@hugovk hugovk merged commit d2e73b0 into python-pillow:master Apr 19, 2021
@radarhere radarhere deleted the resize_default branch April 19, 2021 22:11
radarhere added a commit to radarhere/Pillow that referenced this pull request May 1, 2021
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.

3 participants