add IPTC:Caption-abstract to IPTC:Keywords

Started by Jona, March 07, 2024, 01:54:11 PM

Previous topic - Next topic

Jona

Hello,

I am trying to add IPTC:caption_abstract to existing IPTC:Keywords

I tried several options. I guess I have a confusion with some {} and ''

Initial values of the image
exiftool IMG_2631.JPG -s -G -keywords -caption-abstract
output
[IPTC]          Keywords                        : John, Marie
[IPTC]          Caption-Abstract                : Zoo

Option 1:
exiftool IMG_2631.JPG -s -G -keywords+=${caption-abstract}
output
    1 image files updated
exiftool IMG_2631.JPG -s -G -keywords -caption-abstract
output
[IPTC]          Keywords                        : John, Marie, abstract
[IPTC]          Caption-Abstract                : Zoo

Option 2 and 3:
exiftool IMG_2631.JPG -keywords+=${iptc:caption-abstract}
exiftool IMG_2631.JPG -iptc:keywords=${'iptc:Caption-Abstract'}

output
zsh: unrecognized modifier

Option 4:
exiftool IMG_2631.JPG -iptc:keywords='${iptc:Caption-Abstract}'
Made the following changes
[IPTC]          Keywords                        : ${iptc:Caption-Abstract}
[IPTC]          Caption-Abstract                : Zoo

I tried several others but no success.

Any idea what I am missing?

thank you
Alexandre

I am on Mac

wywh

Try this:

exiftool -a -G1 -s -Keywords -Caption-Abstract a.jpg         
[IPTC]          Keywords                        : John, Marie
[IPTC]          Caption-Abstract                : Zoo

exiftool -overwrite_original '-Keywords+<Caption-Abstract' a.jpg
    1 image files updated

exiftool -a -G1 -s -Keywords -Caption-Abstract a.jpg           
[IPTC]          Keywords                        : John, Marie, Zoo
[IPTC]          Caption-Abstract                : Zoo

- Matti

StarGeek

This is Common Mistake #5c.

QuoteUsing "=" instead of "<" to copy a tag, or using "<" instead of "=" to assign a value.
"<" is used for copying, in which case the source (right-hand-side) operand is interpreted as either

    a tag name (if the operand does not contain a "$" symbol), or
    a string containing tag names prefixed by "$" symbols (if the operand contains a "$" symbol).

"=" is used to assign a simple tag value, and the source operand is a string that is written directly to the destination tag.
(And the combination "<=" is used to assign a tag value from the contents of a file.)

See also FAQ #17, List-type tags
* 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).

Jona

thank you for the responses.
to wywh : it works! thanks
to
StarGeek. I learned more than I asked. Thank you for that. your 2 references are helping me for the future uses of exiftool.

Have a great day/evening