News:

2023-03-15 Major improvements to the new Geolocation feature

Main Menu

How to add CreateDate or DateTimeOriginal to XMP:Subject as keyword

Started by jlwild11, January 15, 2019, 03:08:18 PM

Previous topic - Next topic

jlwild11

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

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}'

StarGeek

Yep, this is Common Mistake #5c.

And don't forget to use +< if you want to avoid overwriting existing keywords.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).