Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0e25859

Browse filesBrowse files
authored
Merge pull request #13415 from meeseeksmachine/auto-backport-of-pr-13405-on-v2.2.x
Backport PR #13405 on branch v2.2.x (Fix imshow()ing PIL-opened images.)
2 parents 1fc42b3 + f6eac94 commit 0e25859
Copy full SHA for 0e25859

File tree

Expand file treeCollapse file tree

1 file changed

+1
-9
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-9
lines changed

‎lib/matplotlib/image.py

Copy file name to clipboardExpand all lines: lib/matplotlib/image.py
+1-9Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -635,15 +635,7 @@ def set_data(self, A):
635635
636636
Note that this function does *not* update the normalization used.
637637
"""
638-
# check if data is PIL Image without importing Image
639-
if hasattr(A, 'getpixel'):
640-
if A.mode == 'L':
641-
# greyscale image, but our logic assumes rgba:
642-
self._A = pil_to_array(A.convert('RGBA'))
643-
else:
644-
self._A = pil_to_array(A)
645-
else:
646-
self._A = cbook.safe_masked_invalid(A, copy=True)
638+
self._A = cbook.safe_masked_invalid(A, copy=True)
647639

648640
if (self._A.dtype != np.uint8 and
649641
not np.can_cast(self._A.dtype, float, "same_kind")):

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.