bugGNU Octave - Bugs: bug #37368, imread errors when passing the...

 
 

bug #37368: imread errors when passing the info option

Submitter:  Carnë Draug <carandraug>
Submitted:  Sun 16 Sep 2012 04:58:36 PM UTC
   
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Fixed Assigned to:  carandraug
Originator Name:  Open/Closed:  * Closed
Release:  * 3.6.2 Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 29 Jul 2013 07:26:02 PM UTC, comment #3: 

I have already fixed 2 weeks ago. It's ignoring the info option since there's nothing we can do about it.

Basically, the info structure in matlab has a list of the file offset where each page of a multipage TIFF starts. The nature of the format requires to transverse all previous pages to find where it starts. Passing such list would speed the reading of an arbitrary page. However, we can't control that using GraphicsMagick.

I have instead implemented the Frame option (matlab compatible) that should be used to read multiple pages, instead of imread in a for loop.

Carnë Draug <carandraug>
Group Member
Fri 30 Nov 2012 07:52:50 AM UTC, comment #2: 

I forgot to start the verbatim environment, only closed it. I recovered what I had submitted from the bug tracker mailing list. This is the code that was missing from the bug report


info = imfinfo (path);
img  = imread (path, "Info", info);


but the following fails (it should retrieve the 2nd page of a multi-page
TIFF):


> info = imfinfo (path);
> img  = imread (path, 2, "Info", info);
error: imread: invalid image file: Invalid call to __magick_read__.  Correct
usage is:

 -- Function File: M = __magick_read__(FNAME, INDEX)
 -- Function File: [M, COLORMAP] = __magick_read__(FNAME, INDEX)
 -- Function File: [M, COLORMAP, ALPHA] = __magick_read__(FNAME, INDEX)

error: called from:
error:   /usr/share/octave/3.6.2/m/image/imread.m at line 74, column 7


Carnë Draug <carandraug>
Group Member
Wed 28 Nov 2012 07:20:24 PM UTC, comment #1: 

I agree that we should just ignore "Info", since Matlab just uses it for perf. Functionality it does not do anything.

Currently imread should error out if more than 3 args are passed in , like 'Index' and 'Info' at the same time. If 'Info' is passed in with the output of IMFINFO, then I do not know what is going to happen.

I'm not sure what your example is producing; I can't see it.

Mark Wistrom <mwistrom>
Sun 16 Sep 2012 04:58:36 PM UTC, original submission:  

Hi

one of the options of imread (in Matlab)  is "Info" which then takes the output of imfinfo to speed up the reading of the image. I understand that it's not implemented (we probably don't need it to speed up anything) but would be handy to at least ignore it. However, it only errors when there's no index used. For example, the following works fine:


info = imfinfo (path);
img  = imread (path, "Info", info);
-verbatim

but the following fails (it should retrieve the 2nd page of a multi-page TIFF):

+verbatim+
> info = imfinfo (path);
> img  = imread (path, 2, "Info", info);
error: imread: invalid image file: Invalid call to __magick_read__.  Correct usage is:

 -- Function File: M = __magick_read__(FNAME, INDEX)
 -- Function File: [M, COLORMAP] = __magick_read__(FNAME, INDEX)
 -- Function File: [M, COLORMAP, ALPHA] = __magick_read__(FNAME, INDEX)

error: called from:
error:   /usr/share/octave/3.6.2/m/image/imread.m at line 74, column 7
-verbatim

Carnë

Carnë Draug <carandraug>
Group Member

 

(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 mwistrom (Posted a comment)
  • -email is unavailable- added by carandraug (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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-07-29 carandraug StatusNone Fixed
        Assigned toNone carandraug
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-cf05.
    Corresponding source code