# HG changeset patch # User Jordi GutiƩrrez Hermoso # Date 1318951029 18000 # Node ID 3ac3b44104e3a06ca0841eb0caee8e4c5865ef38 # Parent 46f5e41c861076d6faa999be09b2b7dbb2fcbd32 imshow: check correctly for complex images (bug #34549) diff -r 46f5e41c8610 -r 3ac3b44104e3 scripts/image/imshow.m --- a/scripts/image/imshow.m Thu Sep 29 17:03:35 2011 -0500 +++ b/scripts/image/imshow.m Tue Oct 18 10:17:09 2011 -0500 @@ -115,6 +115,12 @@ endif endwhile + ## Check for complex images. + if (iscomplex (im)) + warning ("imshow: only showing real part of complex image"); + im = real (im); + endif + ## Set default display range if display_range not set yet. if (isempty (display_range)) display_range = [min(im(:)), max(im(:))]; @@ -130,12 +136,6 @@ endswitch endif - ## Check for complex images. - if (iscomplex (im)) - warning ("imshow: only showing real part of complex image"); - im = real (im); - endif - nans = isnan (im(:)); if (any (nans)) warning ("Octave:imshow-NaN",