diff --git a/skimage/io/_io.py b/skimage/io/_io.py index bf75cf76..6986cc0f 100644 --- a/skimage/io/_io.py +++ b/skimage/io/_io.py @@ -16,7 +16,7 @@ from skimage.color import rgb2grey # Shared image queue _image_stack = [] -URL_REGEX = re.compile(r'http://|https://|ftp://') +URL_REGEX = re.compile(r'http://|https://|ftp://|file://') def is_url(filename): diff --git a/skimage/io/tests/test_io.py b/skimage/io/tests/test_io.py index 72f8496a..b29994c5 100644 --- a/skimage/io/tests/test_io.py +++ b/skimage/io/tests/test_io.py @@ -2,6 +2,7 @@ from numpy.testing import * import numpy as np import skimage.io as io +from skimage import data_dir def test_stack_basic(): @@ -15,5 +16,12 @@ def test_stack_basic(): def test_stack_non_array(): io.push([[1, 2, 3]]) + +def test_imread_url(): + image_url = 'file://%s/camera.png' % data_dir + image = io.imread(image_url) + assert image.shape == (512, 512) + + if __name__ == "__main__": run_module_suite()