ExifTool Forum

ExifTool => Newbies => Topic started by: brunos on October 25, 2019, 01:01:40 PM

Title: Exporting <mwg-rs:Name>value from XMP to a file for many JPGs
Post by: brunos on October 25, 2019, 01:01:40 PM
All,

I'm dealing with about 60 thousands JPG in an archive in 11 thousands data folders under the same root E:\AA\EV.

In XMP of many JPGs (but not all) there is embedded the face recognition data, generated by Picasa 3.9 on MS Windows 10.
I need to generate a report of all the face names in all the JPGs. Looking into XMP's XML, I've found that the data looks like:
            <mwg-rs:RegionList>
               <rdf:Bag>
                  <rdf:li rdf:parseType="Resource">
                     <mwg-rs:Name>at0F Torino 20191012 025</mwg-rs:Name>
                     <mwg-rs:Type>Face</mwg-rs:Type>
                     <mwg-rs:Area rdf:parseType="Resource">
                      ....
and so on further down.

I've tried to locate some example in the forum and elsewhere on Web with the description of how to extract the value of the "Name" field (in many cases it will look like "at0F Torino 20191012 025") but I couldn't find any, and unfortunately, I'm not able to make it by myself.

The output format can be text, preferably one name in every line:

full path to the photo {TAB} the Name value CRLF

eg. in this example one photo contains two faces and therefore the output has two lines:

E:\AA\EV\20190302,AC1,Alzate de Momo,VVS000,(GACI),0000000001\IMG_2218.JPG {TAB} aN0F Ada Gelsemio ¦Milano§ CRLF
E:\AA\EV\20190302,AC1,Alzate de Momo,VVS000,(GACI),0000000001\IMG_2218.JPG {TAB} aN0M Marco Ruspa ¦Torino§ CRLF

Note: most face names (but not all) contain a letter ¦ (pipe) as a delimiter between the face name and the city name and the letter § as the trail of the city name (workarounds for the Picasa's unavoidable partial search). I hope these won't cause troubles to extractor script...

If a JPG doesn't contain any face name, the photo name should still appear in the report without the face name:

E:\AA\EV\20190302,AC1,Alzate de Momo,VVS000,(GACI),0000000001\IMG_2218.JPG {TAB}CRLF

Thanks a million!
Bruno Stivicevic



                   
Title: Re: Exporting <mwg-rs:Name>value from XMP to a file for many JPGs
Post by: Phil Harvey on October 25, 2019, 01:06:43 PM
Hi Bruno,

Try this command:

exiftool -filepath -regionname -T -r E:\AA\EV > out.txt

You will get a dash in the output instead of the RegionName if it doesn't exist, but you can change this to whatever you want by setting the API MissingTagValue option.

- Phil
Title: Re: Exporting <mwg-rs:Name>value from XMP to a file for many JPGs
Post by: brunos on October 25, 2019, 02:03:11 PM
It's a marvelous tool indeed - so simple, so powerful. Thanks! It worked as a charm, delivering exactly the right thing!

Best regards
Bruno