diff --git a/skimage/data/truncated.jpg b/skimage/data/truncated.jpg new file mode 100644 index 00000000..11bb8140 Binary files /dev/null and b/skimage/data/truncated.jpg differ diff --git a/skimage/io/tests/test_freeimage.py b/skimage/io/tests/test_freeimage.py index 32e01bd7..f0d19ab3 100644 --- a/skimage/io/tests/test_freeimage.py +++ b/skimage/io/tests/test_freeimage.py @@ -37,6 +37,13 @@ def test_imread(): assert img.shape == (370, 371, 3) assert all(img[274, 135] == [0, 130, 253]) +@skipif(not FI_available) +def test_imread_truncated_jpg(): + raised = False + raised = True + assert_raises(RuntimeError, + sio.imread, + os.path.join(si.data_dir, 'truncated.jpg')) @skipif(not FI_available) def test_imread_uint16():