mirror of
https://github.com/wassname/scikit-image.git
synced 2026-08-01 12:50:48 +08:00
Move tests to pil plugin and fix file path
This commit is contained in:
@@ -61,26 +61,6 @@ def test_bilevel():
|
||||
assert_array_equal(img.astype(bool), expected)
|
||||
|
||||
|
||||
@skipif(not imread_available)
|
||||
def test_imread_separate_channels():
|
||||
# Test that imread returns RGBA values contiguously even when they are
|
||||
# stored in separate planes.
|
||||
x = np.random.rand(3, 16, 8)
|
||||
f = NamedTemporaryFile(suffix='.tif')
|
||||
fname = f.name
|
||||
f.close()
|
||||
imsave(fname, x)
|
||||
img = imread(fname)
|
||||
os.remove(fname)
|
||||
assert img.shape == (16, 8, 3), img.shape
|
||||
|
||||
|
||||
@skipif(not imread_available)
|
||||
def test_imread_multipage_rgb_tif():
|
||||
img = imread(os.path.join(data_dir, 'multipage_rgb.png'))
|
||||
assert img.shape == (10, 10, 3), img.shape
|
||||
|
||||
|
||||
class TestSave:
|
||||
def roundtrip(self, x, scaling=1):
|
||||
f = NamedTemporaryFile(suffix='.png')
|
||||
|
||||
@@ -50,6 +50,24 @@ def test_imread_flatten():
|
||||
assert np.sctype2char(img.dtype) in np.typecodes['AllInteger']
|
||||
|
||||
|
||||
def test_imread_separate_channels():
|
||||
# Test that imread returns RGBA values contiguously even when they are
|
||||
# stored in separate planes.
|
||||
x = np.random.rand(3, 16, 8)
|
||||
f = NamedTemporaryFile(suffix='.tif')
|
||||
fname = f.name
|
||||
f.close()
|
||||
imsave(fname, x)
|
||||
img = imread(fname)
|
||||
os.remove(fname)
|
||||
assert img.shape == (16, 8, 3), img.shape
|
||||
|
||||
|
||||
def test_imread_multipage_rgb_tif():
|
||||
img = imread(os.path.join(data_dir, 'multipage_rgb.tif'))
|
||||
assert img.shape == (10, 10, 3), img.shape
|
||||
|
||||
|
||||
def test_imread_palette():
|
||||
img = imread(os.path.join(data_dir, 'palette_gray.png'))
|
||||
assert img.ndim == 2
|
||||
|
||||
Reference in New Issue
Block a user