Append metadata on all images based on csv with multiple entries

Started by Taggin, May 01, 2020, 07:18:21 PM

Previous topic - Next topic

Taggin

If you have a collection of JPG images and a csv file containing the filenames and persons name. How do you tag the persons name to the image, especially when there is more than 1 person on the pictures.


SourceFile,Subject
Picture0001.JPG,Adam Able
Picture0002.JPG,Barbara Bubles
Picture0001.JPG,Charly Brown



When I use exiftool -csv+=people.csv .
It doesn't write all persons to the image, but only the last one in csv file.
For example for Picture0001.JPG it only writes "Charly Brown" , but it should write "Adam Able; Charly Brown".



Append: Is there a correct metadata field for persons in jpg picture? I want to search through the pictures metadata in Windows Explorer and Adobe Lightroom. For example: search in Winodws Explorer Folder for "Adam Able" and it shows all photos with him or import the jpgs into Lightroom and it imports the peoples names too.

StarGeek

Phil would have to verify but I'd assume that because the way exiftool has to process a csv, the latter entry is overriding the earlier entry.  You'd have to put in the same cell like this
Picture0001.JPG,"Adam Able, Charly Brown"
and then use the -sep option (-sep ", ") to make sure they get separated into separate entries.  The quotes around the comma indicate that it's part of that cell and not a place to separate into a new column.

Quote from: Taggin on May 01, 2020, 07:18:21 PMAppend: Is there a correct metadata field for persons in jpg picture? I want to search through the pictures metadata in Windows Explorer and Adobe Lightroom.

There is region name tags for use with facial recognition data. I think LR supports it, though I don't know how searchable it may be.  I'm fairly certain that Windows will not read it.  You would use RegionName for the tag.  It's part of the MWG RegionInfo structure.

In order to search for that data with Windows, Subject would probably be the best place.
* 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).

Taggin

Quote from: StarGeek on May 01, 2020, 07:48:58 PM
Phil would have to verify but I'd assume that because the way exiftool has to process a csv, the latter entry is overriding the earlier entry.  You'd have to put in the same cell like this
Picture0001.JPG,"Adam Able, Charly Brown" and then use the -sep option (-sep ", ") to make sure they get separated into separate entries.  The quotes around the comma indicate that it's part of that cell and not a place to separate into a new column.
Ufff. The csv has 30.000 lines and I don't know how to merge the keywords with a formular.  :-\

Phil Harvey

Quote from: StarGeek on May 01, 2020, 07:48:58 PM
Phil would have to verify but I'd assume that because the way exiftool has to process a csv, the latter entry is overriding the earlier entry.

Yes.  ExifTool expects the file names in the first column to be unique.  If they aren't, subsequent entries will override earlier ones with the same SourceFile.

I can't think of any easy way offhand to do what you want other than writing a simple script to preprocess the .csv file.  I could process this for you if you want to send me the .csv (philharvey66 at gmail.com).

- 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

* 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).

Taggin

Thank You guys, the exiftool and forum are really outstanding!
It all worked out. I sorted it with Excel and the formulars shown in the video.
And appended person data in Subject field with exiftool.exe -csv+=people.csv -sep ", " -overwrite_original .

Awesome. :D