ExifTool Forum

ExifTool => Newbies => Topic started by: JoshInDC on November 07, 2022, 06:25:37 PM

Title: Write/Copy Problem with DateTimeOriginal when using xmp2exif.args
Post by: JoshInDC on November 07, 2022, 06:25:37 PM
Hi,

I have written some Dublin Core metadata to a jpg (-xmp-dc:Creator for example), and was trying to use xmp2exif.arg to write some of the Dublin Core over to the EXIF metadata fields.

I used the following command to basically do the copy:

exiftool -tagsFromFile jpg.jpg -@ xmp2exif.args jpg.jpg



This seems to work correctly with the original xmp2exif.args file (and my modified version, see below), and I am able to get the Dublin Core Title, Rights, and Creator metadata to transfer correctly. I even sent the Dublin Core Description field to the EXIF:Software field, and it seemed to work fine.



But I wanted the Dublin Core Date (XMP-dc:Date) to land in the -EXIF:DateTimeOriginal field... so I modified the xmp2exif.args file. Here is the relevant line:

-EXIF:DateTimeOriginal < XMP-dc:Date 00:00:00

I had to add the 00:00:00 on the end as I was getting an error.



But unfortunately, the transfer of the DateTimeOriginal metadata is not working. I can manually write the metadata using a command like the following:


exiftool -exif:DateTimeOriginal="2005:12:23 00:00:00" jpg.jpg


Any thoughts why the xmp2exif.args method of metadata copying is not working for the -EXIF:DateTimeOriginal field, but works for the other fields?

Title: Re: Write/Copy Problem with DateTimeOriginal when using xmp2exif.args
Post by: StarGeek on November 07, 2022, 08:57:32 PM
Change the line to
-EXIF:DateTimeOriginal<$XMP-dc:Date 00:00:00

The problem is that you're adding a static string directly to the tag.  Because of this, exiftool is looking for a tag called "XMP-dc:Date 00:00:00"

You need to add a dollar sign $ to the start of the string in order to combine a tag value with a static string.  See the paragraph that starts "An extension of the redirection feature" under the -TagsFromFile option (https://exiftool.org/exiftool_pod.html#tagsFromFile-SRCFILE-or-FMT).