mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-06-29 09:23:11 +03:00
Better error messaging in PIL.image.fromarray
This commit is contained in:
parent
bb1fc75e55
commit
47691906df
|
@ -2633,7 +2633,7 @@ def fromarray(obj, mode=None):
|
||||||
typekey = (1, 1) + shape[2:], arr["typestr"]
|
typekey = (1, 1) + shape[2:], arr["typestr"]
|
||||||
mode, rawmode = _fromarray_typemap[typekey]
|
mode, rawmode = _fromarray_typemap[typekey]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
raise TypeError("Cannot handle this data type")
|
raise TypeError("Cannot handle this data type: %s, %s" % typekey)
|
||||||
else:
|
else:
|
||||||
rawmode = mode
|
rawmode = mode
|
||||||
if mode in ["1", "L", "I", "P", "F"]:
|
if mode in ["1", "L", "I", "P", "F"]:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user