diff --git a/skimage/data/chessboard_GRAY_U16B.tif b/skimage/data/chessboard_GRAY_U16B.tif new file mode 100644 index 00000000..f1230ba2 Binary files /dev/null and b/skimage/data/chessboard_GRAY_U16B.tif differ diff --git a/skimage/io/tests/test_pil.py b/skimage/io/tests/test_pil.py index b01bd42f..021c74ea 100644 --- a/skimage/io/tests/test_pil.py +++ b/skimage/io/tests/test_pil.py @@ -58,6 +58,13 @@ def test_imread_uint16(): assert img.dtype == np.uint16 assert_array_almost_equal(img, expected) +@skipif(not PIL_available) +def test_imread_uint16_big_endian(): + expected = np.load(os.path.join(data_dir, 'chessboard_GRAY_U8.npy')) + img = imread(os.path.join(data_dir, 'chessboard_GRAY_U16B.tif')) + assert img.dtype == np.dtype('>u2') + assert_array_almost_equal(img, expected) + class TestSave: def roundtrip(self, dtype, x, scaling=1):