# HG changeset patch # User carandraug # Date 1334164407 0 # Node ID d6a7e7268581de58d3cb620a2f94acf62cc18e13 # Parent 7dbbeef8470702ccae8942add6460ba22a54f00d im2double: fix small bug where isind would be called wrongly diff --git a/inst/im2double.m b/inst/im2double.m --- a/inst/im2double.m +++ b/inst/im2double.m @@ -36,10 +36,10 @@ ## @seealso{im2bw, im2uint16, im2uint8} ## @end deftypefn -function im = im2double (im, ind = false) +function im = im2double (im, indexed = false) ## Input checking (private function that is used for all im2class functions) - im_class = imconversion (nargin, "im2double", ind, im); + im_class = imconversion (nargin, "im2double", indexed, im); switch im_class case "double" @@ -47,9 +47,9 @@ case {"logical", "single"} im = double (im); case {"uint8", "uint16"} - if (ind) + if (indexed) im = double (im) + 1; - elseif (isind (im)) + else im = double (im) / double (intmax (im_class)); endif case "int16"