bugGNU Octave - Bugs: bug #60664, [MXE Octave] cannot work with RAW...

 
 

bug #60664: [MXE Octave] cannot work with RAW images - dcraw command fails

Submitted by:  None
Submitted on:  Mon 24 May 2021 04:14:16 PM UTC  
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error or Warning
Status:  Ready For Test Assigned to:  None
Originator Name:  Tomas Hudziec Originator Email:  -email is unavailable-
Open/Closed:  Open Release:  dev
Operating System:  Microsoft Windows

Add a New Comment (Rich Markup)
   

You are not logged in

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

 

( Jump to the original submission)

Fri 04 Jun 2021 12:58:13 PM UTC, comment #6: 

I pushed a patch to MXE Octave here that adds the version of dcraw from upstream GraphicsMagick:
https://hg.octave.org/mxe-octave/rev/c23139e3560e

This change will be part of Octave 7 for Windows.

If you'd like to test earlier, you could download an MXE-default build from tomorrow (05 June 2021) or later from here:
https://buildbot.octave.space/#/download

Marking as ready for test.

Markus Mützel <mmuetzel>
Project Member
Tue 25 May 2021 10:58:38 AM UTC, comment #5: 

I tried with one of the files from http://rawsamples.ch:

>> imfinfo('C:\Users\Markus\Downloads\RAW_CANON_1DM2.CR2')
Will not write an image to the terminal!
Magick: "dcraw" -c -w -6 -T "C:\Users\Markus\Downloads\RAW_CANON_1DM2.CR2" > "C:\Users\Markus\AppData\Local\Temp\gmrrjsL7".
error: Magick++ exception: Magick: Delegate failed ("dcraw" -c -w -6 -T "%i" > "%o") reported by magick/delegate.c:907 (InvokeDelegate)
error: called from
    __imfinfo__ at line 39 column 8
    imageIO at line 125 column 28
    imfinfo at line 166 column 8

However, it works if I execute the same command directly:

>> system(['"dcraw" -c -w -6 -T "C:\Users\Markus\Downloads\RAW_CANON_1DM2.CR2" > "C:\Users\Markus\AppData\Local\Temp\gmrrjsL7"'])
ans = 0

I can open the resulting TIFF, e.g. with MS Paint.

I'm not sure what is causing this or how they solved it upstream. The upstream bug report doesn't link any changes in particular.

To check if this will work in principle, I installed GraphicsMagick, copied their "dcraw.exe" over to the Octave "bin" directory and replaced the "mingw64\lib\GraphicsMagick-1.3.36\config\delegates.mgk" with the one attached here.
After those changes, the "imfinfo" command worked with the .raw image file.

I'm also attaching their "dcraw.exe" for now. But we should maybe try to fix this in MXE Octave.

(file #51472, file #51473)

Markus Mützel <mmuetzel>
Project Member
Tue 25 May 2021 09:53:17 AM UTC, comment #4: 

Might be related to this report against graphicsmagick:
https://sourceforge.net/p/graphicsmagick/bugs/205/

We'd probably need to change something in our build rule for graphicsmagick in MXE Octave to have our Windows installer bundle a working version of dcraw?

The dcraw sources seem to be included in their git repository:
http://hg.code.sf.net/p/graphicsmagick/code/file/tip/dcraw

I haven't checked their tarball yet.

Markus Mützel <mmuetzel>
Project Member
Tue 25 May 2021 09:16:31 AM UTC, comment #3: 

Thank you both for quick answers. Some raw images can be obtained e.g. at [1]. Yes, Markus, you understand it correctly. I didn't know, that dcraw isn't bundled with the Windows installer, thanks for pointing out.

From the link you mentioned I put the dcraw binary (dcraw.exe renamed from dcraw64.exe) into "C:\Program Files\GNU Octave\Octave-6.2.0\mingw64\bin" folder. (It required administrator privileges - I know, that putting it somewhere else and setting the PATH env. variable would not require them, but I haven't tried it.)

Now the dcraw executes, but somehow it fails to recognize the output redirection and it complains, that it will not write its result to the standard output (terminal).

>> imread ("CRW_7268.crw");
Will not write an image to the terminal!
Magick: "dcraw" -c -w -6 -T "D:\CRW_7268.crw" > "C:\Users\TOMAS~1.HUD\AppData\Local\Temp\gmw4nqtb"
.
error: Magick++ exception: Magick: Delegate failed ("dcraw" -c -w -6 -T "%i" > "%o") reported by m
agick/delegate.c:907 (InvokeDelegate)
error: called from
    __imread__ at line 75 column 10
    imageIO at line 125 column 28
    imread at line 102 column 33

By the way, the output should be a file, not a folder (I mean that in Local\Temp), shouldn't it?

[1]: http://rawsamples.ch

Tomáš Hudziec <tomas_hudziec>
Tue 25 May 2021 07:36:23 AM UTC, comment #2: 

I don't have a .raw image file to test with. But if I understand the error message correctly, GraphicsMagick tries to call "dcraw" to convert the image to a format it can understand.
However, "dcraw" isn't bundled with the Windows installer.

The Wikipedia page for dcraw [1] links to this page that provides Windows binaries for that program:
https://www.fastpictureviewer.com/downloads/#links

Could you try and download that program from that page and drop it into the "mingw64/bin" folder inside the Octave installation folder? Alternatively, please try to add the path to the "dcraw.exe" to the PATH environment variable.

Does that avoid the error?

[1]: https://en.wikipedia.org/wiki/Dcraw

Markus Mützel <mmuetzel>
Project Member
Tue 25 May 2021 03:17:33 AM UTC, comment #1: 

Works properly on Linux. Might be specific to the Windows version?

Anonymous
Mon 24 May 2021 04:14:16 PM UTC, original submission:  

When I want to open some RAW image with imread or show info with imfinfo, the command fails:

>> imfinfo ("DSC07754.ARW")
Magick: "dcraw" -c -w -6 -T "D:\DSC07754.ARW" > "C:\Users\TOMAS~1.HUD\AppData\Local\Temp\gmcY7sLb"
.
error: Magick++ exception: Magick: Delegate failed ("dcraw" -c -w -6 -T "%i" > "%o") reported by magick/delegate.c:907 (InvokeDelegate)
error: called from
    __imfinfo__ at line 39 column 8
    imageIO at line 125 column 28
    imfinfo at line 166 column 8

It is a fresh instalation of Octave 6.2.0.

Loading "image" package did not help.

I also tried images in other RAW formats like NEF, CR2, crw, but same error shows.

Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #51472:  delegates.mgk added by mmuetzel (8KiB - application/octet-stream)
file #51473:  dcraw.zip added by mmuetzel (153KiB - application/x-zip-compressed)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by tomas_hudziec (Posted a comment)
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by None (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 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-06-04 mmuetzel StatusConfirmed => Ready For Test
        Release6.2.0 => dev
    2021-05-25 mmuetzel Attached File- => Added delegates.mgk, #51472
        Attached File- => Added dcraw.zip, #51473
    2021-05-25 mmuetzel StatusNeed Info => Confirmed
        Summarycannot work with RAW images - dcraw command fails => [MXE Octave] cannot work with RAW images - dcraw command fails
    2021-05-25 mmuetzel Item GroupNone => Unexpected Error or Warning
        StatusNone => Need Info

    Back to the top


    Powered by Savane 3.6