"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "skimage/io/tests/test_imageio.py" between
scikit-image-0.18.1.tar.gz and scikit-image-0.18.3.tar.gz

About: scikit-image is a collection of algorithms for image processing in Python.

test_imageio.py  (scikit-image-0.18.1):test_imageio.py  (scikit-image-0.18.3)
skipping to change at line 33 skipping to change at line 33
# check that conversion does not happen for a gray image # check that conversion does not happen for a gray image
assert np.sctype2char(img.dtype) in np.typecodes['AllInteger'] assert np.sctype2char(img.dtype) in np.typecodes['AllInteger']
def test_imageio_palette(): def test_imageio_palette():
img = imread(fetch('data/palette_color.png')) img = imread(fetch('data/palette_color.png'))
assert img.ndim == 3 assert img.ndim == 3
def test_imageio_truncated_jpg(): def test_imageio_truncated_jpg():
# imageio>2.0 uses Pillow / PIL to try and load the file. # imageio>2.0 uses Pillow / PIL to try and load the file.
# Oddly, PIL explicitly raises a SyntaxError when the file read fails. # Oddly, PIL explicitly raises a SyntaxError when the file read fails.
with testing.raises(SyntaxError): # The exception type changed from SyntaxError to OSError in PIL 8.2.0, so
# allow for either to be raised.
with testing.raises((OSError, SyntaxError)):
imread(fetch('data/truncated.jpg')) imread(fetch('data/truncated.jpg'))
class TestSave(TestCase): class TestSave(TestCase):
def roundtrip(self, x, scaling=1): def roundtrip(self, x, scaling=1):
f = NamedTemporaryFile(suffix='.png') f = NamedTemporaryFile(suffix='.png')
fname = f.name fname = f.name
f.close() f.close()
imsave(fname, x) imsave(fname, x)
y = imread(fname) y = imread(fname)
 End of changes. 1 change blocks. 
1 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)