mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-06 05:16:40 +08:00
ENH: Add test and support for reading file URLs
This commit is contained in:
+1
-1
@@ -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):
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user