Skip to content

Commit

Permalink
Fixed toimage bug with complex array inputs.
Browse files Browse the repository at this point in the history
  • Loading branch information
teoliphant committed Oct 27, 2002
1 parent 8a80338 commit 4d3ec69
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Lib/pilutil.py
Expand Up @@ -100,6 +100,8 @@ def toimage(arr,high=255,low=0,cmin=None,cmax=None,pal=None,
The Numeric array must be either 2 dimensional or 3 dimensional.
"""
data = Numeric.asarray(arr)
if iscomplexobj(data):
raise ValueError, "Cannot convert a complex-valued array."
shape = list(data.shape)
valid = len(shape)==2 or ((len(shape)==3) and \
((3 in shape) or (4 in shape)))
Expand Down

0 comments on commit 4d3ec69

Please sign in to comment.