changeset 26817:880466837c06

imshow.m: Read indexed images correctly when only file name given (bug #49137). * imshow.m: After call to imread, check whether map is empty or not to determine whether image is indexed.
author Rik <rik@octave.org>
date Sat, 02 Mar 2019 23:21:13 -0800
parents 92ecc4a97b5c
children 670ebc29ec69
files scripts/image/imshow.m
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/image/imshow.m	Thu Feb 28 23:06:25 2019 +0100
+++ b/scripts/image/imshow.m	Sat Mar 02 23:21:13 2019 -0800
@@ -86,8 +86,12 @@
   ## Get the image.
   if (ischar (im))
     [im, map] = imread (im);
-    indexed = true;
-    colormap (gca, map);
+    if (isempty (map))
+      indexed = false;
+    else
+      indexed = true;
+      colormap (gca, map);
+    endif
   endif
 
   nd = ndims (im);