That's a good start. I tried simplifying the delegate line. Initially I tried using the -O, but of course (and consistent with what you said) my DCRAW version doesn't contain that custom option. Still, I thought I'd see what happens when it was stripped down like this:
Code: Select all
<delegate decode="dng:decode" stealth="True" command="dcraw -6 -w "%i""/>
And while I'm not sure exactly what it did, it definitely did something as it took some time to process it instead of just dying.[/code]
This was the initial output I got and I should note in this case the CR2 file did NOT disappear. So something to do with the piping is evidently moving the file. It's possible I'm using the %o and %i incorrectly and so it's getting overwritten, but I'm not sure. Initial output below:
Code: Select all
dev01::~/dcraw/#> convert IMG_1830.CR2 abc3.jpg
convert: unable to open image `/tmp/magick-PlL9WblE.ppm': No such file or directory @ error/blob.c/OpenBlob/2642.
convert: no images defined `abc3.jpg' @ error/convert.c/ConvertImageCommand/3046.
So then I ran the same thing using the same delegate formatting only with verbose mode:
Code: Select all
dev01::~/dcraw/#> convert -verbose IMG_1830.CR2 abc3.jpg
dcraw -6 -w "/tmp/magick-VW1XalCm"
convert: unable to open image `/tmp/magick-wYn24Bx8.ppm': No such file or directory @ error/blob.c/OpenBlob/2642.
convert: no images defined `abc3.jpg' @ error/convert.c/ConvertImageCommand/3046.
Perhaps more importantly about this part is that the tmp file ID that is is looking for there HAS been created as a PPM file in my /tmp/ directory.
Code: Select all
-rw-rw-r-- 1 ludlow ludlow 62539795 Nov 7 19:38 magick-VW1XalCm.ppm
The second file, `/tmp/magick-wYn24Bx8.ppm', however is NOT in the /tmp/ directory. So it seems that DCRAW is definitely taking the CR2 file as one would expect. Moreover it's processing it. But then it seems that ImageMagick doesn't know how to return it to the same directory I'm working in. The abc3.jpg file does not exist within the directory.
As one more tiny experiment I ran DCRAW from the command line by itself with the identical parameters from the delegate file.
Code: Select all
dev01::~/dcraw/#> dcraw -6 -w IMG_1830.CR2
And that created this file in the same working directory (as I think we might expect at this point):
Code: Select all
-rw-rw-r-- 1 ludlow ludlow 62539795 Nov 7 19:43 IMG_1830.ppm
So anyway, the DCRAW portion is definitely doing it's thing. The trick is that I then have to convert that to JPG using cjpeg albeit haven't figured out exactly how to convert the PPM file using cjpeg. I can do it when DCRAW writes to STDOUT and then it gets piped into cjpeg, but not from a file itself. Weirdly still is that I can just use ImageMagick to convert the PPM file over to JPG!
Point being that all of the individual pieces are working, I just want to figure out how to make them work within the delegate handler so that I can rely on ImageMagick for all of my files (rather than fork my code so that any CR2 file uses some custom method I've come up with). I'm even cool writing a simple BASH script that I could then have the delegate invoke. Anyone know if that might be possible?
And if I didn't say so already, thank you very much for the thought on this.