News:

2023-03-15 Major improvements to the new Geolocation feature

Main Menu

Multiple tag values into keywords in a single command

Started by timfulcher, January 21, 2017, 12:44:47 PM

Previous topic - Next topic

timfulcher

Hi,

Firstly thanks Phil for all your hard work with this (if you by any chance read this).

If this has been posted somewhere, apologies, just point me in the right direction. I did look but couldn't find anything obvious.

Adding multiple keywords to image files is fine, but I can't figure out an elegant means of adding multiple exif tags to the keywords - for instance I want to add LensID, Model, DOF etc to each image file in a folder of files. The only solution I've found is run exiftool multiple times, which is inelegant and I therefore presume I'm missing something really obvious.

Is there an equivalent of exiftool -sep ", " -keywords=Nikon, D300, 35mm f/1.8 G, ISO 640... please for the information contained in the metadata?

Thanks for your time

Tim

StarGeek

There's an example in the Copying examples part of the docs, though it's a further down the list

exiftool '-keywords+<make' image.jpg
    Add camera make to list of keywords


Just do the same for the tags you want: "-keywords+<Model" "-keywords+<LensID"
* 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).

timfulcher

Thanks for replying, but I'd already tried that with single quotes (from the same source), but tried it with double just in case. This method enters the last value in the list, so:
exiftool "-keywords+<ISO" "-keywords+<Model" "-keywords+<LensID"  ./Image1copy.NEF
just gives me:
Lens ID                         : AF-S Nikkor 70-200mm f/4G ED VR
Keywords                        : AF-S Nikkor 70-200mm f/4G ED VR
Camera Model Name               : NIKON D200

That's why I was assuming I was missing something really simple.
Thanks
Tim

Phil Harvey

It's not really simple.  You need to do this:

exiftool -addtagsfromfile @ "-keywords+<ISO" "-keywords+<Model" "-keywords+<LensID"  ./Image1copy.NEF

This is explained in the application documentation:

            5) The normal behaviour of copied tags differs subtly from that of
            assigned tags for list-type tags.  When copying to a list, each
            copied tag overrides any previous operations on the list.  While
            this avoids duplicate list items when copying groups of tags from
            a file containing redundant information, it also prevents values
            of different tags from being copied into the same list when this
            is the intent.  So a -addTagsFromFile option is provided which
            allows copying of multiple tags into the same list.


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

timfulcher

Thanks Phil, I saw the -addtagsfromfile in a post when I was searching for an answer but didn't understand the relevance to this. I'll have another read about this.

Thanks again

Tim