mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-07 18:21:44 +08:00
BUG: basestring not defined on PY3
This commit is contained in:
@@ -11,6 +11,8 @@ except ImportError:
|
||||
|
||||
from skimage.util import img_as_ubyte
|
||||
|
||||
from skimage._shared import six
|
||||
|
||||
|
||||
def imread(fname, dtype=None):
|
||||
"""Load an image from file.
|
||||
@@ -104,7 +106,7 @@ def imsave(fname, arr, format_str=None):
|
||||
arr = arr.astype(np.uint8)
|
||||
|
||||
# default to PNG if file-like object
|
||||
if not isinstance(fname, basestring) and format_str is None:
|
||||
if not isinstance(fname, six.string_types) and format_str is None:
|
||||
format_str = "PNG"
|
||||
|
||||
img = Image.fromstring(mode, (arr.shape[1], arr.shape[0]), arr.tostring())
|
||||
|
||||
Reference in New Issue
Block a user