TST skimage.io.imread returns incorrect dimensions

This commit is contained in:
Christoph Gohlke
2015-05-07 15:07:59 -07:00
parent 3c8bf02fa5
commit 47cfcb4b8b
+15
View File
@@ -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')