Main Menu

Copy Keywords

Started by maha, December 02, 2019, 09:21:50 AM

Previous topic - Next topic

maha

Hi, I am new and I think Exiftool can help me to copy keywords.

I have CR2 and JPG Originals in a complex folder structure next to DNGs that I tagged and keyworded in Lightroom. Yes, the JPG are also in a DNG Envelop.

How can I transfer all keywords from the DNGs to the respective (same filename) CR2 or JPG? Recursively (-r)  througout my folder structure.

If there are already Keywords in the XMP sidecar (written with photo mechanic) they can be delete.

What would the syntax look like?

thanks in advance,
MaHa



Phil Harvey

Hi MaHa,

The basic command to copy keywords from DNG to JPG and CR2 is this:

exiftool -tagsfromfile %d%f.DNG -keywords -ext cr2 -ext jpg -r DIR

This will work if we are talking IPTC/IIM Keywords, but if we are talking XMP keywords, then these are the XMP:Subject tag, and you should replace -keywords with -subject in the command.

You can also add -ext xmp to the command to also copy the keywords to the sidecar XMP file.  But in this case, you would definitely use -subject.

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

maha


maha

Ok, that works only partly. All original files (cr2, cr3, jpg and arw) got renamed to "_original" file and a new files have been created with the result, that I was running out of diskspace.
I thought the metadata is in the sidecar file (XMP)
My next test was C:\exiftool>exiftool -tagsfromfile %d%f.DNG -subject -ext xmp -r "DIR.... but only the keyword are beeing copied to a new XMP file. all other information is gone.

The leaves me with two questions:
1. How to roll back to _original files and delete the newly created ones
2. How to copy subject from DNG to (cr2, cr3, jpg and arw) without writing new files


Phil Harvey

Quote from: maha on December 02, 2019, 11:05:25 AM
1. How to roll back to _original files and delete the newly created ones

exiftool -restore_original -r DIR

Quote2. How to copy subject from DNG to (cr2, cr3, jpg and arw) without writing new files

Add -overwrite_original to the command.  But then you lose the ability to restore the originals as above.

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

StarGeek

Quote from: maha on December 02, 2019, 11:05:25 AM
I thought the metadata is in the sidecar file (XMP)

Exiftool will write data to the RAW files, which is what the above command does.  If you want to write to the sidecar files, you have to specify the sidecars, not the raw extensions.

QuoteMy next test was C:\exiftool>exiftool -tagsfromfile %d%f.DNG -subject -ext xmp -r "DIR.... but only the keyword are beeing copied to a new XMP file. all other information is gone.

This should copy the Subject tag to existing XMP sidecar without affecting other data.  It will overwrite previously existing values in the Subject tag.  If you want to add additional keywords without overwriting the previous values, you can use either
"-Subject+<Subject"
or use -AddTagsFromFile instead of -TagsFromFile  See note 5 under the -TagsFromFile option.
* 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).