Copying people tags from Mylio XMP files to JPGs

Started by magarlick, June 07, 2018, 07:02:49 PM

Previous topic - Next topic

magarlick

Dear all

I've just come across exiftool and I'm nos impressed. Thanks so much for making it available.

I am using Mylio to tag people in my photos. It creates XMP sidecars with the people names listed as in the attachment. The names are specified next to "mwg-rs:Name". You'll need to look at the file to see what I mean. Can somebody please tell me how I can copy this name information and add it to the JPG metadata in a meaningful tag. I'm guessing "subject" would be the place to put the names, comma-separated if possible.

Can this be done?

Thanks for your help, folks.

Mark Garlick


StarGeek

#1
Assuming the sidecar file has the same name (except for the extension) and is in the same directory as the main file, you can copy it to Subject using this command.  Replace FileOrDir with the files and/or directories you want to process.
exiftool -TagsFromFile %d%f.xmp "-Subject<RegionName" FileOrDir

If you want to also embed the facial recognition regions in the jpg, you can just add -RegionInfo as well
exiftool -TagsFromFile %d%f.xmp "-Subject<RegionName" -RegionInfo FileOrDir

Take a look at the Metadata Sidecar Files for more examples.

These commands creates backup files.  Add -overwrite_original to suppress the creation of backup files.  Add -r to recurse into subdirectories.  If this command is run under Unix/Mac, reverse any double/single quotes to avoid bash interpretation.

Edit: Fixed error in example command.
* 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).

magarlick

You are indeed a Star Geek. Thanks for your helpful reply. It works.

Best wishes to you.

M.

magarlick

Hello again

Actually, I spoke too soon. It's not doing what I wanted.

If I run this command a single file, it copies the names from the XMP to the Tags portion of the JPG:

exiftool -TagsFromFile @ FILE.xmp "-Subject<RegionName" -RegionInfo FILE.JPG

But if I run the command you suggested for a batch of files, it doesn't put anything into the JPG Tags field at all, even though it says it processed the files. I get "Error opening file - %d%f.xmp". The XMP files have the same names as their corresponding JPGs.

In addition, it is not the Tags field of the JPG I am trying to populate. When I right click on a photo in windows, and select the details tab, at the top - under description - is says Subject. Tags is underneath that. I want to copy the name info into Subject. Can that be done?

Any idea why the command doesn't work on multiple files?

Many thanks for your help.

Phil Harvey

Ah.  Remove the "@" from the command line.

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

magarlick

Thanks, Phil. I did remove the @. Sorry, I just copied it down wrong in my previous message. These are the commands I used:

exiftool -TagsFromFile FILE.xmp "-Subject<RegionName" -RegionInfo FILE.JPG

This works. Copies info to Tags field on JPGs.

exiftool -TagsFromFile @ %d%f.xmp "-Subject<RegionName" -RegionInfo DIR

This doesn't work. I get "Error opening file - %d%f.xmp". The XMP files have the same names as their corresponding JPGs.

IN any case, trying to write to the Subject field in the JPG.

Thanks

Phil Harvey

Quote from: magarlick on June 08, 2018, 09:24:16 AM
exiftool -TagsFromFile @ %d%f.xmp "-Subject<RegionName" -RegionInfo DIR

This doesn't work. I get "Error opening file - %d%f.xmp".

Remove the "@".
...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

Sorry, my mistake with regards to the @ symbol.  I have a text expansion entry that automatically expands to -TagsFromFile @ and I used it out of habit, forgetting to remove the @ symbol.
* 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).