Recursively copy IFDO dng to tiff

Started by elliotnewmam, October 16, 2014, 06:00:12 PM

Previous topic - Next topic

elliotnewmam

I am trying to copy dng specific tags, which I've got working, but now trying to get it working recursively... Here is what I have so far, but it's not working yet:...

exiftool -tagsfromfile %d%f.dng "'-ExifIFD:ColorMatrix1<IFD0:ColorMatrix1' '-ExifIFD:ColorMatrix2<IFD0:ColorMatrix2' '-ExifIFD:AnalogBalance<IFD0:AnalogBalance' '-ExifIFD:CameraCalibration1<IFD0:CameraCalibration1' '-ExifIFD:CameraCalibration2<IFD0:CameraCalibration2' '-ExifIFD:AsShotNeutral<IFD0:AsShotNeutral' '-ExifIFD:CalibrationIlluminant1<IFD0:CalibrationIlluminant1' '-ExifIFD:CalibrationIlluminant2<IFD0:CalibrationIlluminant2' '-ExifIFD:ForwardMatrix1<IFD0:ForwardMatrix1' '-ExifIFD:ForwardMatrix2<IFD0:ForwardMatrix2'" -r -ext tiff .

The directory I am running this in contains .dng and .tiff files, both share filename.

exiftool outputs:

    1 directories scanned
    4 image files updated


It also seems to take a while to run, I guess that's because I should be running the command with the overwrite original so not to write extra tiff data to disk?

Phil Harvey

So what is going wrong?  It looks like there were only 4 "tiff" files in the directory.

Adding -overwrite_original does not speed things up at all.  How big are these tiff files?

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

elliotnewmam

93mb tiff files. I guess this type of tag modification requires the image data to be re-written?

Sorry I should have been more descriptive, exiftool reports that 4 files have been updated, and comparing them to the original tiffs they are bigger, but the crucial IFDO exif data is missing - Color Matrix, Camera Calibration etc.

I do know this command works:

exiftool -tagsfromfile filename.dng '-ExifIFD:ColorMatrix1<IFD0:ColorMatrix1' '-ExifIFD:ColorMatrix2<IFD0:ColorMatrix2' '-ExifIFD:AnalogBalance<IFD0:AnalogBalance' '-ExifIFD:CameraCalibration1<IFD0:CameraCalibration1' '-ExifIFD:CameraCalibration2<IFD0:CameraCalibration2' '-ExifIFD:AsShotNeutral<IFD0:AsShotNeutral' '-ExifIFD:CalibrationIlluminant1<IFD0:CalibrationIlluminant1' '-ExifIFD:CalibrationIlluminant2<IFD0:CalibrationIlluminant2' '-ExifIFD:ForwardMatrix1<IFD0:ForwardMatrix1' '-ExifIFD:ForwardMatrix2<IFD0:ForwardMatrix2' filename.tiff

I am now trying to modify it to work through all dngs and tiffs in the directory.

Phil Harvey

ExifTool always re-writes the file.  This isn't strictly necessary, but it is the technique that ExifTool uses.

If the ColorMatrix is missing, then you should confirm that the information exists in the source file.  If it does, then try copying it separately, perhaps with the -v2 option, to see what warnings ExifTool gives.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

elliotnewmam

Ok, so found out the issue - it was due to the double quotation marks. The following now works fine:

exiftool -tagsfromfile %d%f.dng '-ExifIFD:ColorMatrix1<IFD0:ColorMatrix1' '-ExifIFD:ColorMatrix2<IFD0:ColorMatrix2' '-ExifIFD:AnalogBalance<IFD0:AnalogBalance' '-ExifIFD:CameraCalibration1<IFD0:CameraCalibration1' '-ExifIFD:CameraCalibration2<IFD0:CameraCalibration2' '-ExifIFD:AsShotNeutral<IFD0:AsShotNeutral' '-ExifIFD:CalibrationIlluminant1<IFD0:CalibrationIlluminant1' '-ExifIFD:CalibrationIlluminant2<IFD0:CalibrationIlluminant2' '-ExifIFD:ForwardMatrix1<IFD0:ForwardMatrix1' '-ExifIFD:ForwardMatrix2<IFD0:ForwardMatrix2' -r -ext tiff .

Phil Harvey

Ah.  I didn't notice those in your first command.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).