bugGNU Octave - Bugs: bug #51738, [octave forge] (image) bug in...

 
 

bug #51738: [octave forge] (image) bug in montage function

Submitted by:  Tyson Whitehead <twhitehead>
Submitted on:  Sat 12 Aug 2017 03:09:55 PM UTC  
 
Category:  Octave Forge Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  Closed
Release:  other Operating System:  GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 06 Sep 2017 03:29:14 PM UTC, comment #3:

Thank you very much for addressing this Carnë (and so promptly too!).

Cheers! -Tyson

Tyson Whitehead <twhitehead>
Sun 13 Aug 2017 12:29:25 AM UTC, comment #2:

> and it looks to me like it should be
>
> [images(:,:,:,page_range), map] = imread (img_info.Filename, 1:nPages);
>
> as img_info is the current image according to the earlier line


Needs to be 'img_info(1).Filename' because while img_info is already the imfinfo for the current image, if the current image is a multipage file, then it will be a struct array.

I have fixed this now with http://hg.code.sf.net/p/octave/image/rev/c38a1f64dafb

> The earlier check on line 144
>
> if (size (images, 3) == 1 || all (strcmp {img_info(:).ColorType}, "truecolor")))
>
> also looks suspect to me as again img_info is the current image info and not the collection of image infos.


A multipage file may have a combination of colortypes, between binary, grayscale, and RGB (truecolor). That 'img_info(:)' checks that they are all RGB.

Carnë Draug <carandraug>
Project Member
Sun 13 Aug 2017 12:25:26 AM UTC, comment #1:

http://hg.code.sf.net/p/octave/image/rev/c38a1f64dafb

Carnë Draug <carandraug>
Project Member
Sat 12 Aug 2017 03:09:55 PM UTC, original submission:

Running the montage function on a series of greyscale images returns the following error

octave> montage({"grey1.png","grey2.png"})

error: montage: A(I): index out of bounds; value 2 out of bound 1
error: called from
montage at line 146 column 39

The culprit line 146 is

[images(:,:,:,page_range), map] = imread (img_info(idx).Filename, 1:nPages);

and it looks to me like it should be

[images(:,:,:,page_range), map] = imread (img_info.Filename, 1:nPages);

as img_info is the current image according to the earlier line

img_info = infos{idx};

Cheers! -Tyson

PS: The earlier check on line 144

if (size (images, 3) == 1 || all (strcmp {img_info(:).ColorType}, "truecolor")))

also looks suspect to me as again img_info is the current image info and not the collection of image infos.

Tyson Whitehead <twhitehead>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jwe (Updated the item)
  • -email is unavailable- added by mtmiller (Updated the item)
  • -email is unavailable- added by twhitehead (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

     

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-07-02 jwe Summary[octave-forge] (image) bug in montage function => [octave forge] (image) bug in montage function
    2017-08-13 carandraug StatusNone => Fixed
        Open/ClosedOpen => Closed
        Release4.0.1 => other
    2017-08-12 mtmiller Item GroupNone => Unexpected Error
        Summarybug in montage function => [octave-forge] (image) bug in montage function

    Back to the top


    Powered by Savane 3.3