ExifTool Forum

ExifTool => Newbies => Topic started by: jlwild11 on January 15, 2019, 03:08:18 PM

Title: How to add CreateDate or DateTimeOriginal to XMP:Subject as keyword
Post by: jlwild11 on January 15, 2019, 03:08:18 PM
I can add a keyword and create the XMP: Subject:

./exiftool -P -overwrite_original -xmp:subject='first tag' "/volume1/uploads/Phone_Jameson/"


I have tried variations of:

./exiftool -P -overwrite_original -xmp:subject+=${CreateDate} "/volume1/uploads/Phone_Jameson/"


I also dont know what the $ and {} are used for. just saw them in my searches for a solution.

I would also like to limit it to just the year and be able to combine it with some text so the keyword would display as "Year: 2019".
Title: Re: How to add CreateDate or DateTimeOriginal to XMP:Subject as keyword
Post by: jlwild11 on January 15, 2019, 06:30:30 PM
Figured it out finally.

"-xmp:subject<CreateDate"

or for just the year,

-d %Y "-xmp:subject<CreateDate"


Needed the " around everything and < symbol

And with a little more trial and error I got the Year: 2019 I was looking to achieve with ' around everything:

-d %Y '-xmp:subject+<Year: ${CreateDate}'
Title: Re: How to add CreateDate or DateTimeOriginal to XMP:Subject as keyword
Post by: StarGeek on January 15, 2019, 08:02:02 PM
Yep, this is Common Mistake #5c (https://sno.phy.queensu.ca/~phil/exiftool/mistakes.html#M5).

And don't forget to use +< if you want to avoid overwriting existing keywords.