Page 1 of 1

DNG Delegate Fails When Statically Linking

Posted: 2014-09-08T16:14:14-07:00
by vhmth
So my current setup is IM 6.8.9-5 compiled to a .a static archive file which is linked against Go -> C Bindings (https://github.com/gographics/imagick). I noticed that delegate.c contained the mapping for delegates, and I changed:

Code: Select all

"  <delegate decode=\"dng:decode\" command=\""/usr/bin/ufraw-batch" --silent --wb=camera --black-point=auto --exposure=auto --create-id=also --out-type=ppm16 "--output=%u.pnm" "%i"\"/>"
to

Code: Select all

"  <delegate decode=\"dng:decode\" command=\""ufraw-batch" --silent --wb=camera --black-point=auto --exposure=auto --create-id=also --out-type=ppm --out-depth=16 "--output=%u.ppm" "%i"\"/>"
per running into this bug: https://bugs.launchpad.net/ubuntu/+sour ... bug/371791

I also tried changing it to output PNG, based on the code I had read in coders/dng.c (it seems to try to read a .ppm file and then falls back to a png if it couldn't find one):

Code: Select all

"  <delegate decode=\"dng:decode\" command=\""ufraw-batch" --silent --wb=camera --black-point=auto --exposure=auto --create-id=also --out-type=png --out-depth=16 "--output=%u.png" "%i"\"/>"
The result of changing this line in delegate.c is that I no longer get an error saying IM couldn't find the pnm file. However, now I am able to read an image blob that represents a CR2 into a wand, but when I try to do MagickGetImageBlob, an array of length 0 is returned. Furthermore, what's weird is that the image itself is about 6.3MB, but it comes out to be about 32MB when it's read into the wand. Any ideas?

Re: DNG Delegate Fails When Statically Linking

Posted: 2014-09-08T16:27:22-07:00
by snibgo
vhmth wrote:Furthermore, what's weird is that the image itself is about 6.3MB, but it comes out to be about 32MB when it's read into the wand.
I expect this is because the CR2 file is compressed, but the wand image in memory isn't.

Sorry, I can't help with your other questions.

Re: DNG Delegate Fails When Statically Linking

Posted: 2014-09-09T15:05:39-07:00
by vhmth
@snibgo Ah that makes sense. Any other magick gurus - bump? A bit of additional info: I wrote a script to watch the /tmp directory and copy any new items to my Desktop when I read the image into the wand, and it seems like the PNG is being created properly, so I'm at a lost as to what is going on.

Re: DNG Delegate Fails When Statically Linking

Posted: 2014-09-15T12:22:27-07:00
by vhmth
Bump?

Re: DNG Delegate Fails When Statically Linking

Posted: 2014-09-15T22:27:27-07:00
by vhmth
I'm still curious as to why this is happening, but I ended up writing a little bit of C that converted a RAW image to a TIFF with libraw (http://www.libraw.org/). I then convert from there using VIPS.