ENH: Allow imshow to show images when given file name.

This commit is contained in:
Tony S Yu
2012-08-22 22:10:32 -04:00
parent 1c3aeec2a8
commit de20e482ad
+4 -2
View File
@@ -138,8 +138,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
@@ -151,6 +151,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)