mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-05 06:30:56 +08:00
TST skimage.io.imread returns incorrect dimensions
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user