-
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 for rotate fill with Images of type F #1828
Conversation
@@ -1078,7 +1078,7 @@ def test_rotate(self): | |||
def test_rotate_fill(self): | |||
img = F.to_pil_image(np.ones((100, 100, 3), dtype=np.uint8) * 255, "RGB") | |||
|
|||
modes = ("L", "RGB") | |||
modes = ("L", "RGB", "F") | |||
nums_bands = [len(mode) for mode in modes] | |||
fill = 127 |
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.
Lets see if this works with mode=="F"
and an int value >1
.
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.
We can create F
images with arbitrary float values in it, including > 1 it seems
PIL.Image.fromarray(np.full((10, 10), 5.))
Codecov Report
@@ Coverage Diff @@
## master #1828 +/- ##
======================================
Coverage 0.43% 0.43%
======================================
Files 92 92
Lines 7386 7386
Branches 1111 1111
======================================
Hits 32 32
Misses 7346 7346
Partials 8 8
Continue to review full report at Codecov.
|
Summary: Pull Request resolved: #1829 Reviewed By: lerks Differential Revision: D19619779 Pulled By: fmassa fbshipit-source-id: 0a210f90d58102da59dfb8ab1b3f93c619d0507f
Bugfix which was introduced in #1760.
It turns out that whenever the image is of type
F
we can't pass a tuple of one element forfill
but instead we need indeed to pass it as a number.cc @pmeier