How to store ISO-8601 in XMP?

Started by Tom OReilly, July 16, 2020, 02:28:04 PM

Previous topic - Next topic

Tom OReilly

I would like to write an ISO-8601 timestring verbatim to XMP metadata, including decimal seconds, e.g. "2020-03-12T17:34:08.987Z"

My configuration file defines:

%Image::ExifTool::UserDefined = (
   # XMP tags may be added to existing namespaces:
   'Image::ExifTool::XMP::xmp' => {

      # Trigger time in ISO-8601 format
      CameraTriggerTime => { Groups => { 2 => 'Other' } },
      
   },
);

1;

When I write CameraTriggerTime, the 8601 format is somehow being altered by exiftool, e.g.:

$ exiftool -config test.config  -xmp-xmp:CameraTriggerTime=2020-03-12T17:34:08.987Z test.jpg
    1 image files updated
$ exiftool -S test.jpg | grep Trigger
CameraTriggerTime: 2020:03:12 17:34:08.987Z


Why is the string format being changed? How can I write "2020-03-12T17:34:08.987Z" verbatim as an XMP tag?
Or is there an exiftool feature that will store an ISO-8601 time like this?

Thanks!



Phil Harvey

Hi Tom,

It is being written verbatim, but changed to standard ExifTool format when reading.  To avoid it being changed when reading, either use your config file or set the API XMPAutoConv option to 0 with -api xmpautoconv=0.

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