mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-13 17:45:20 +08:00
Fix imread from urls on some backends.
Some backends infer the image type from the extension. This fix just adds the extension to the temp filename.
This commit is contained in:
+2
-1
@@ -130,7 +130,8 @@ def imread(fname, as_grey=False, plugin=None, flatten=None,
|
||||
as_grey = flatten
|
||||
|
||||
if is_url(fname):
|
||||
with tempfile.NamedTemporaryFile(delete=False) as f:
|
||||
_, ext = os.path.splitext(fname)
|
||||
with tempfile.NamedTemporaryFile(delete=False, suffix=ext) as f:
|
||||
u = urllib2.urlopen(fname)
|
||||
f.write(u.read())
|
||||
img = call_plugin('imread', f.name, plugin=plugin, **plugin_args)
|
||||
|
||||
Reference in New Issue
Block a user