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 PackageSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Unexpected Error
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: otherOperating 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 File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

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

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 13 Aug 2017 12:25:26 AM UTCcarandraugStatusNone=>Fixed
      Open/ClosedOpen=>Closed
      Release4.0.1=>other
    Sat 12 Aug 2017 05:13:31 PM UTCmtmillerItem GroupNone=>Unexpected Error
      Summarybug in montage function=>[octave-forge] (image) bug in montage function

    Back to the top


    Powered by Savane 3.1-cleanup1