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

 
 

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

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

Add a New Comment Rich Markup
   

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>
Group Member
Sun 13 Aug 2017 12:25:26 AM UTC, comment #1: 
Carnë Draug <carandraug>
Group 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 twhitehead (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-02-26 mtmiller Carbon-CopyRemoved 80942 -
    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 or Warning
        Summarybug in montage function [octave-forge] (image) bug in montage function

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code