tomkyle / negatives-linear-tiff

Converts RAW/NEF/CR2 files into linear TIFF files, using GNU Parallel for maximum speed. Other features: B/W grayscaling, TIF resizing and ZIP compression.
https://tomkyle.github.io/negatives-linear-tiff
Other
7 stars 1 forks source link

Check input file with dcraw -i #18

Open tomkyle opened 7 years ago

tomkyle commented 7 years ago

In function convertRawPhotos, we need to check first if the very image can be decoded at all. Currently, the script relies on the common Raw file extensions known as working well. Buuuut:

From dcraw documentation: “dcraw -i: Identify files … Exit status is 0 if dcraw can decode the last file, 1 if it can't.”

Alternatively, as I am working on using libraw's dcraw_emu, one should try the raw-identify command.

raw-identify: The only LibRaw call it uses is open_file(); further code prints the values of the fields of the imgdata structure. The output of raw-identify (without switches) is virtually identical to the output of dcraw -i.”