copying exact metadata

Started by jozsi, June 06, 2012, 04:58:53 PM

Previous topic - Next topic

jozsi

Hello, I'm a newbie, trying to copy metadata from one tiff file to another. I see that some of the tags, namely rational-type tags are not the same in the new tiff image. For example 'ApertureValue' is '6.625 (434176/65536)' in the original and 6.614857048 (80053/12102) in the new tiff file. By using the '-n' option the tag is 6.625 (53/8). But FocalPlaneXResolution is still not correct ('4438.355957 (1163488384/262144)' in the original, '4438.355932 (261863/59)'). Not much a difference I have to admit, but is there any option to make the tags exactly the same (including the exact numerator and denominator)? I'm using the following command: exiftool -tagsfromfile original.tif -all:all -n new.tif

Phil Harvey

ExifTool rationalizes floating point values to an accuracy of 8 decimal places, which is good enough for more people.  ;)

Also, Exiftool reduces the rational to the lowest terms, which will change values like 120/10 to 12/1.  So you will see these differences too when copying rationals.

However, ExifTool does allow you to specify simple EXIF rational values in fractional form, which gives you full control over the numerator/denominator when writing.  But unfortunately there is currently no option like -n which allows these values to be extracted as rationals, so this doesn't work when copying.  (The -v option shows the rational, but doesn't help for copying.)

You could modify ExifTool to use a precision of 10 decimal points instead of 8, but using your example you would get a rational of 9089753/2048 instead of 1163488384/262144 in this case -- the rational is identical, but ExifTool reduces the fraction to the lowest terms.

- 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 ($).

jozsi

Thanks for your reply.
Does the exporting metadata first to a sidecar file and then importing that to the new image results an exact copy? I should test it myself, but maybe you can answer faster.

Phil Harvey

The only way you get an exact copy is to export all EXIF as a block with -exif.  But this is the same for copying between files.  The problem is that it will overwrite any existing EXIF in the target file.

- 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 ($).

jozsi

Quote from: Phil Harvey on June 07, 2012, 03:10:44 PM
The only way you get an exact copy is to export all EXIF as a block with -exif.  But this is the same for copying between files.  The problem is that it will overwrite any existing EXIF in the target file.

- Phil

Thanks, overwriting existing metadata in the target file is not a problem (in fact it would be the goal). I asked all this because Digital Photo Professional writes uncompressed tifs and I had the idea to convert them to compressed and then transfer all metadata exactly as DPP had written them.

Phil Harvey

The only problem here is that EXIF can't be copied as a block from TIFF images. This is because the image data is mixed with the metadata in the TIFF image, so copying as a block would copy the entire file.

- 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 ($).

jozsi

Ok, then I will use -n. Thanks for your help.