News:

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

Main Menu

Copy keywords a lot jpg

Started by Aleixa, May 25, 2020, 11:38:52 AM

Previous topic - Next topic

Aleixa

I am a new user of ExifTool, and I have a large amount of JPG that has received "keywords" from different people (the same files ...), using Bridge.

As I understand it, they were created in IPTC.

I am unsure about the command line.

Was going to start with a batch of 600 images. And it seemed to me that this would be the command line

That's right?

exiftool -tagsfromfile d:\teste_Bis_tagged\%f.%e -ext JPG d:\teste_metadata\

Where
d:\teste_Bis_tagged\%f.%e
is the home subdirectory
and
the target subdirectory.
The destination files must be updated with the "keywords" of the files (with the same names, and the same extension) of the source path.



I want the keywords to be added, without deleting the ones that already exist

StarGeek

Keyword tags are list type tags.  They need to be copied with -AddTagsFromFile (see Note 5 under the -TagsFromFile option).

Additionally, keywords may be located in two different locations, IPTC:Keywords (the old IPTC IIM/Legacy tag) and XMP:Subject (the newer IPTC Core tag).  Since you are receiving files from different people, you probably want to copy both.

So test this out
exiftool -ext JPG -AddTagsFromFile d:\teste_Bis_tagged\%f.%e -Subject -Keywords d:\teste_metadata\
The -ext JPG part was fine where it was. I only moved it to make it more clear what tags were being copied with the TagsFromFile option.
* 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).

Aleixa

Thank you!
However ... it did not work properly, as I wish.

The keywords of the file I want to update are not preserved ...

In other words, DSTFILE has 5 keywords, and SRCFILE has 6, of which 4 are new. The DSTFILE should have 9 keywords.

But that does not happen: it is only with the 6 of the SRCFILE, and the others that existed are all deleted ...

Maybe some command is missing, which I don't know.

StarGeek

Sorry, this is something that I seem to always mess up.

It gets more complicated because Bridge won't automatically combine duplicated keywords like I thought it might.

Ok, getting messy, but try this, it seemed to work for me
exiftool -ext JPG -AddTagsFromFile d:\teste_Bis_tagged\%f.%e "-Subject-<Subject" "-Subject+<Subject" "-IPTC:Keywords-<IPTC:Keywords" "-IPTC:Keywords+<IPTC:Keywords" d:\teste_metadata\

Ok, what this does is first it takes all the keywords that are in the source files Subject tag and the Keywords tag, removed them from the target file, and then add them back in.  This will prevent any duplicate keywords from appearing.

I added the IPTC group name to the Keywords tag because without it there would be a minor Shift value warning.  It wouldn't affect the process but makes for better output.

Example output:
C:\>exiftool -g1 -a -s -keywords y:\!temp\Test3.jpg  y:\!temp\Test4.jpg
======== y:/!temp/Test3.jpg
---- IPTC ----
Keywords                        : one, two, three, four
======== y:/!temp/Test4.jpg
---- IPTC ----
Keywords                        : three, four, five, six, seven
    2 image files read

C:\>exiftool -P -overwrite_original -addtagsfromfile y:\!temp\Test3.jpg  "-iptc:keywords-<keywords" "-iptc:keywords+<keywords"  y:\!temp\Test4.jpg
    1 image files updated

C:\>exiftool -g1 -a -s -keywords y:\!temp\Test3.jpg  y:\!temp\Test4.jpg
======== y:/!temp/Test3.jpg
---- IPTC ----
Keywords                        : one, two, three, four
======== y:/!temp/Test4.jpg
---- IPTC ----
Keywords                        : one, two, three, four, five, six, seven
* 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).