Creating multiple images from same metadata field

Started by vectorlad, September 14, 2016, 11:00:26 AM

Previous topic - Next topic

vectorlad

Hello,

If possible I would like to process my files and have it create an extra jpeg for an additional name. So it would create one file for Josh, one for Jason and so forth.

Is this possible with exiftool?

My jpegs all have multiple or single names in the creator field. While I was successful in processing images that only had one name. I am having issues with ones that have more.

The jpegs that have multiple names process, but all create an odd file with hard returns after each name. I have noticed that the names entered in the Creator field did have a return after each, for example:

JOSH
JASON
SUZY

The command line I have used so far is:

exiftool '-filename<creator' /Users/admin/Desktop/test


Thanks for any help!

Phil Harvey

Is this XMP:Creator that you are using?  ExifTool should return this as a comma-separated list (ie. no newlines).

One way to do what you want would be to create a set of user-defined Composite tags (Creator1, Creator2, Creator3, etc), each for a specific item in the Creator list.  Then the command could look like this:

exiftool "-filename<%d${creator3}.%e" -o . -execute "-filename<%d${creator2}.%e" -o . -execute "-filename<%d${creator1}.%e" -common_args DIR

I could help with the config file for these user-defined tags if I had a sample with the metadata you are using.

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

vectorlad

Hi Phil,
Thanks for your quick reply!

Sorry I should have mentioned that I used Adobe Bridge to enter the names into the Creator field under IPTC Core. With that in mind do I still need to edit the config file for user-defined tags?

Here are some samples of my metadata:
Image 1
         <dc:creator>
            <rdf:Seq>
               <rdf:li>Josh</rdf:li>
               <rdf:li>Suzy</rdf:li>
               <rdf:li>Jimmy</rdf:li>
            </rdf:Seq>
         </dc:creator>

Image 2
         <dc:creator>
            <rdf:Seq>
               <rdf:li>John</rdf:li>
               <rdf:li>Suzy</rdf:li>
               <rdf:li>Laura</rdf:li>
            </rdf:Seq>
         </dc:creator>

Image 3
         <dc:creator>
            <rdf:Seq>
               <rdf:li>Regina</rdf:li>
               <rdf:li>John</rdf:li>
               <rdf:li>James</rdf:li>
            </rdf:Seq>
         </dc:creator>

Thanks!

Phil Harvey

OK, so you're using XMP dc:creator.  This should work fine, and shouldn't have produced the newlines in the file name.

Actually, I just realized we can take advantage of a seldom-used ExifTool feature (the -listItem option) to avoid the need for user-defined tags.  The command could be:

exiftool -listItem 2 "-filename<%d${creator}%-c.%e" -o . -execute -listItem 1 "-filename<%d${creator}%-c.%e" -o . -execute -listItem 0 "-filename<%d${creator}%-c.%e" -common_args DIR

Here I have added %-c to the file name to give an index number in cases where the person is in multiple images.

This will work for up to 3 people in an image.  You will need to add more cases if there can be more people.

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

vectorlad