Author Topic: How to add CreateDate or DateTimeOriginal to XMP:Subject as keyword  (Read 263 times)

jlwild11

  • Newbie
  • *
  • Posts: 2
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".

jlwild11

  • Newbie
  • *
  • Posts: 2
Re: How to add CreateDate or DateTimeOriginal to XMP:Subject as keyword
« Reply #1 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}'
« Last Edit: January 16, 2019, 01:52:00 AM by jlwild11 »

StarGeek

  • Global Moderator
  • ExifTool Freak
  • *****
  • Posts: 2748
Re: How to add CreateDate or DateTimeOriginal to XMP:Subject as keyword
« Reply #2 on: January 15, 2019, 08:02:02 PM »
Yep, this is Common Mistake #5c.

And don't forget to use +< if you want to avoid overwriting existing keywords.
Troubleshooting hints:
* When posting, include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).
* Double all percent signs (%) in a Windows batch file.
* If your GPS coords are negative, make sure and set the GpsLatitudeRef and GpsLongitudeRef tags correctly.