[patch] fix dcraw emulation binary

Attached is a patch which fixes the dcraw_emu output filename from eg 'raw.nef.ppm' to 'raw.ppm' or 'raw.tiff'; this brings the behaviour inline with Dave Coffin's dcraw tool.

AttachmentSize
Plain text icon libraw-patch.txt776 bytes

Forums: 

This is not bug, this is

This is not bug, this is feature. So, no need to fix it

-- Alex Tutubalin @LibRaw LLC

well...

Just to ensure I didn't get anything wrong: dcraw_emu appends to the output filename, rather than changing the extension, ie 'foo.nef' becomes 'foo.nef.tiff'; this is clearly not what the user expects, and there is no way to specify the resulting filename.

The patch I propose addresses the unexpected behaviour, also bringing it inline with DCRAW's behaviour. I see no good reasons for keeping the unexpected behaviour, and I was careful to use bounded copies etc.

I was thinking this patch should go into the libraw 0.13 stream, no? If not, for what reasons?

Thanks, Daniel

Sure, dcraw_emu appends .tiff

Sure, dcraw_emu appends .tiff or .ppm to existing image filename.

This is very useful if someone (e.g. me) uses both dcraw and dcraw_emu in parallel (for example, for results comparsion): one program does not overwrites results of another one.

Also, if you have both DSCF0001.ARW a DSCF0001.NEF (from Sony and Nikon, respectively), 'dcraw DSCF0001.*' will produce only one resulting file, while dcraw_emu will save both results in separate files.

-- Alex Tutubalin @LibRaw LLC