-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Fix fill parameter for PIL pad #2515
Conversation
@@ -261,8 +261,7 @@ def pad(img, padding, fill=0, padding_mode="constant"): | |||
raise ValueError("Padding mode should be either constant, edge, reflect or symmetric") | |||
|
|||
if padding_mode == "constant": | |||
if isinstance(fill, numbers.Number): | |||
fill = (fill,) * len(img.getbands()) | |||
fill = _parse_fill(fill, img, "2.3.0")["fillcolor"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've traced back the min_version
to python-pillow/Pillow@20b9d97, but you could probably go even further back. Still, I think its sufficient because I think a lot of the functionalities we are using require a higher version be default
Codecov Report
@@ Coverage Diff @@
## master #2515 +/- ##
==========================================
+ Coverage 70.60% 71.27% +0.67%
==========================================
Files 94 94
Lines 7995 8290 +295
Branches 1272 1395 +123
==========================================
+ Hits 5645 5909 +264
+ Misses 1947 1945 -2
- Partials 403 436 +33
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot!
* fix fill parameter for PIL pad * add test * fix * lint
Fixes #2512