bugGNU Octave - Bugs: bug #39791, imwrite error

 
 

bug #39791: imwrite error

Submitter:  Cristian <r41nm4n>
Submitted:  Thu 15 Aug 2013 01:27:33 PM UTC
   
 
Category:  Libraries Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 17 Aug 2013 04:21:27 PM UTC, comment #2: 

Thank you for the report and the tests. The bug was caused by a really stupid thing I done. It is fixed now. All the 9 tests we had in imwrite are for failures so when I actually broke something the tests were useless.

But I'll be applying a slightly different patch, one that only runs if octave's been configured to deal with images, and with a unwind_protect to make sure the file is removed for sure, no matter what happens during the reading and writing.


%!testif HAVE_MAGICK
%! imw = randi (255, 100, "uint8");
%! filename = [tmpnam() ".png"];
%! unwind_protect
%!   imwrite (imw, filename);
%!   imr = imread (filename);
%! unwind_protect_cleanup
%!   unlink (filename);
%! end_unwind_protect
%! assert (imw, imr)


Carnë Draug <carandraug>
Group Member
Thu 15 Aug 2013 01:41:09 PM UTC, comment #1: 

Same patch, properly formatted.


(file #28852)

Cristian <r41nm4n>
Thu 15 Aug 2013 01:27:33 PM UTC, original submission:  

With octave dev version, hg id e3870f594d8b I get the following error:


>> imwrite(0, 'tmp.png')
error: 'map' undefined near line 31 column 39
error: evaluating argument list element number 1
error: called from:
error:   /usr/local/share/octave/3.7.5/m/image/private/__imwrite__.m at line 31, column 3
error:   /usr/local/share/octave/3.7.5/m/image/imwrite.m at line 83, column 5


I am attaching a patch that adds a test to imwrite.m useful to highlight this and other possible errors: the test works with octave 3.6.4 and fails with current dev version.

Cristian <r41nm4n>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #28852:  imwrite.patch added by r41nm4n (877B - text/x-diff)
file #28850:  imwrite.patch added by r41nm4n (873B - text/x-diff)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by r41nm4n (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 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-08-17 carandraug StatusNone Fixed
        Open/ClosedOpen Closed
    2013-08-15 r41nm4n Attached File- Added imwrite.patch, #28852
    2013-08-15 r41nm4n Attached File- Added imwrite.patch, #28850

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code