ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: Jona on March 07, 2024, 01:54:11 PM

Title: add IPTC:Caption-abstract to IPTC:Keywords
Post by: Jona on March 07, 2024, 01:54:11 PM
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
Title: Re: add IPTC:Caption-abstract to IPTC:Keywords
Post by: wywh on March 07, 2024, 02:11:55 PM
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
Title: Re: add IPTC:Caption-abstract to IPTC:Keywords
Post by: StarGeek on March 07, 2024, 02:56:40 PM
This is Common Mistake #5c (https://exiftool.org/mistakes.html#M5).

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 (https://exiftool.org/faq.html#Q17)
Title: Re: add IPTC:Caption-abstract to IPTC:Keywords
Post by: Jona on March 07, 2024, 04:18:56 PM
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