Merge pull request #258 from tonysyu/imshow-filename

ENH: Allow imshow to show images when given file name.
This commit is contained in:
Stefan van der Walt
2012-08-24 02:56:45 -07:00
+4 -2
View File
@@ -185,8 +185,8 @@ def imshow(arr, plugin=None, **plugin_args):
Parameters
----------
arr : ndarray
Image data.
arr : ndarray or str
Image data or name of image file.
plugin : str
Name of plugin to use. By default, the different plugins are
tried (starting with the Python Imaging Library) until a suitable
@@ -198,6 +198,8 @@ def imshow(arr, plugin=None, **plugin_args):
Passed to the given plugin.
"""
if isinstance(arr, basestring):
arr = call_plugin('imread', arr, plugin=plugin)
return call_plugin('imshow', arr, plugin=plugin, **plugin_args)