# HG changeset patch # User Carnë Draug # Date 1384301540 0 # Node ID c98ffba88c780f6942716e6ebe22127c7dc25513 # Parent c2bbbef6ab1f5ab8658e2e71e14f276dbb539e09 imread: ping image correctly when "Index" or "Frames" option is "all". * private/__imread__.m: when the "Index" or "Frames" options were set with the string "all", its first letter was being used as index for the image to ping. Fix this by using an index of 1 for such cases. In addition, add the "Frames" and "Index" to the loop processing the options and skip them (it was causing an error about invalid option). diff -r c2bbbef6ab1f -r c98ffba88c78 scripts/image/private/__imread__.m --- a/scripts/image/private/__imread__.m Tue Nov 12 17:33:30 2013 -0800 +++ b/scripts/image/private/__imread__.m Wed Nov 13 00:12:20 2013 +0000 @@ -92,7 +92,11 @@ try ## Use information from the first image to be read to set defaults. - info = __magick_ping__ (fn, options.index(1)); + if (ischar (options.index) && strcmpi (options.index, "all")) + info = __magick_ping__ (fn, 1); + else + info = __magick_ping__ (fn, options.index(1)); + endif ## Set default for options. options.region = {1:1:info.rows 1:1:info.columns}; @@ -100,6 +104,9 @@ for idx = offset:2:(numel (varargin) - offset + 1) switch (tolower (varargin{idx})) + case {"frames", "index"} + ## Do nothing. This options were already processed before the loop. + case "pixelregion", options.region = varargin{idx+1}; if (! iscell (options.region) || numel (options.region) != 2)