diff --git a/skimage/io/tests/test_imread.py b/skimage/io/tests/test_imread.py index 759e8c67..4f172ebb 100644 --- a/skimage/io/tests/test_imread.py +++ b/skimage/io/tests/test_imread.py @@ -1,3 +1,4 @@ +import os import os.path import numpy as np from numpy.testing import * @@ -60,6 +61,20 @@ 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.zeros((3, 16, 8), np.uint8) + f = NamedTemporaryFile(suffix='.tif') + fname = f.name + f.close() + imsave(fname, x, plugin='tifffile') + img = imread(fname) + os.remove(fname) + assert img.shape == (16, 8, 3), img.shape + + class TestSave: def roundtrip(self, x, scaling=1): f = NamedTemporaryFile(suffix='.png')