8000 TST convert 2-d PIL image · matplotlib/matplotlib@e0fab0d · GitHub
[go: up one dir, main page]

Skip to content

Commit e0fab0d

Browse files
committed
TST convert 2-d PIL image
1 parent 332edf0 commit e0fab0d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

lib/matplotlib/tests/test_image.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,18 @@ def test_nonuniformimage_setnorm():
511511
im.set_norm(plt.Normalize())
512512

513513

514+
@needs_pillow
515+
def test_jpeg_2d():
516+
# smoke test that mode-L pillow images work.
517+
imd = np.ones((10, 10), dtype='uint8')
518+
for i in range(10):
519+
imd[i, :] = np.linspace(0.0, 1.0, 10) * 255
520+
im = Image.new('L', (10, 10))
521+
im.putdata(imd.flatten())
522+
fig, ax = plt.subplots()
523+
ax.imshow(im)
524+
525+
514526
@needs_pillow
515527
def test_jpeg_alpha():
516528
plt.figure(figsize=(1, 1), dpi=300)

0 commit comments

Comments
 (0)
0