freeimage: Correctly handle saving uint16 images (closes gh-1101)

This commit is contained in:
Stefan van der Walt
2014-08-15 15:22:51 +02:00
parent a3638024e7
commit 2b1dde202f
2 changed files with 22 additions and 11 deletions
+3 -3
View File
@@ -81,15 +81,15 @@ class TestSave:
f.close()
sio.imsave(fname, x)
y = sio.imread(fname)
assert_array_equal(x, y)
assert_array_equal(y, x)
@skipif(not FI_available)
def test_imsave_roundtrip(self):
for shape, dtype, format in [
[(10, 10), (np.uint8, np.uint16), ('tif', 'png')],
[(10, 10), (np.float32,), ('tif',)],
[(10, 10, 3), (np.uint8,), ('png',)],
[(10, 10, 4), (np.uint8,), ('png',)]
[(10, 10, 3), (np.uint8, np.uint16), ('png',)],
[(10, 10, 4), (np.uint8, np.uint16), ('png',)]
]:
tests = [(d, f) for d in dtype for f in format]
for d, f in tests: