changeset 13716:3ac3b44104e3 stable

imshow: check correctly for complex images (bug #34549)
author Jordi Gutiérrez Hermoso <jordigh@octave.org>
date Tue, 18 Oct 2011 10:17:09 -0500
parents 46f5e41c8610
children fcdf0993b8c9
files scripts/image/imshow.m
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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",