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

Function similar to pad but returns resized image without padding #5415

Closed
axu2 opened this issue Apr 19, 2021 · 2 comments · Fixed by #5417
Closed

Function similar to pad but returns resized image without padding #5415

axu2 opened this issue Apr 19, 2021 · 2 comments · Fixed by #5417

Comments

@axu2
Copy link

axu2 commented Apr 19, 2021

I'd sure like a function that looks like ImageOps.pad
https://pillow.readthedocs.io/en/stable/_modules/PIL/ImageOps.html#pad

but just returns the image after resizing without adding the padding.

What would be a good name for such a function? Where would it best be placed?

ImageOps.fit is already taken.

EDIT: Looking at #3364 contain seems like a decent candidate. Seems a refactor would be required. @radarhere thoughts?

@radarhere
Copy link
Member

I've created #5417, going with contain. Let us know if you have any thoughts.

@axu2
Copy link
Author

axu2 commented Apr 19, 2021

Seems good, honestly fit would have been a better choice, but that's already taken. And fit should have been called fill

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

Successfully merging a pull request may close this issue.

2 participants