Floating point XMP tag value is rounded to integer

Started by Tom OReilly, July 15, 2020, 08:29:57 PM

Previous topic - Next topic

Tom OReilly

My configuration file contains this entry:

             CameraTriggerTime => {
                                Writable => 'rational',
                                Description => 'camera trigger time',
                                Groups => { 2 => 'Location' } },

Then I write CameraTriggerTime to an image and then display the value:
$ exiftool -config exiftool.config  -xmp-xmp:CameraTriggerTime=1584034455.86999 DSC00020.JPG 
    1 image files updated
$ exiftool -S DSC00020.JPG | grep Trigger
CameraTriggerTime: 1584034456

Why does the value of CameraTriggerTime get rounded?
Thanks!

Phil Harvey

A rational is a ratio of two integers, each of which have a maximum value.  Typically you only get 8 digits of precision from a 64-bit rational the way that ExifTool writes them.

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

Tom OReilly

Thanks Phil.
So 'real' (not 'rational') displays a floating point number.

Phil Harvey

They both display a floating point number.  However, 'rational' is stored as a fraction, and 'real' is stored as a floating point number.

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