ExifTool Forum

ExifTool => Newbies => Topic started by: mike1950r on January 13, 2022, 04:16:21 PM

Title: Append Comment
Post by: mike1950r on January 13, 2022, 04:16:21 PM
Hi,

is there an option to append a comment at the end of an existing one?
(in case no comment exists, this would create a new comment.)

thanks for info.

cheers mike
Title: Re: Append Comment
Post by: Phil Harvey on January 13, 2022, 04:30:04 PM
Hi Mike,

This will do exactly what you asked:

exiftool "-comment<${comment} Add This" -m FILE

- Phil
Title: Re: Append Comment
Post by: mike1950r on January 14, 2022, 11:00:22 AM
Thanks lot Phil,

this works exellent.

Just one more question:
Is there an option to append only if a -comment tag is already existing?

Cheers mike

BTW
In my system the "Comment" tag works only as "UserComment" tag.
Is this windows specific? (windows7 pro 64bit)
Title: Re: Append Comment
Post by: StarGeek on January 14, 2022, 01:40:32 PM
Quote from: mike1950r on January 14, 2022, 11:00:22 AM
In my system the "Comment" tag works only as "UserComment" tag.

Your mistaking the Windows property of "Comment" for the actual tag.  They are not the same.  The Windows "Comment" property will read any of these three tags
EXIF:UserComment
EXIF:XPComment
XMP-exif:UserComment

See this post (https://exiftool.org/forum/index.php?topic=6591.msg32875#msg32875) for a table of which tags translate to which Windows properties.

Quote from: mike1950r on January 14, 2022, 11:00:22 AM
Is there an option to append only if a -comment tag is already existing?

You can use the -if option (https://exiftool.org/exiftool_pod.html#if-NUM-EXPR)
exiftool -if "$UserComment" "-UserComment<${UserComment} Add This" FILE
Title: Re: Append Comment
Post by: Phil Harvey on January 14, 2022, 05:12:48 PM
Just remove the -m option from my command to add only if it already exists.  @StarGeek, the -if option isn't necessary here because the copy will fail without -m if the tag doesn't exist.

- Phil
Title: Re: Append Comment
Post by: StarGeek on January 14, 2022, 06:26:58 PM
True but it will give an error response and inexperience users tend to freak out about such things.
Title: Re: Append Comment
Post by: mike1950r on January 15, 2022, 02:20:10 PM
Thanks Phil and StarGeek,

for the infos.

Appending works excellent.

Just a question concerning the "Content" tag.

How can I remove these all together:
EXIF:UserComment
EXIF:XPComment
XMP-exif:UserComment
UserComment


In fact these all seem to be the user comments.

Thanks for information

Cheers mike

BTW
In windows7 right mouse clicking and then on details,
I get only the "UserComment" tag displayed, which I use so far.

Title: Re: Append Comment
Post by: StarGeek on January 15, 2022, 02:56:28 PM
Quote from: mike1950r on January 15, 2022, 02:20:10 PM
How can I remove these all together:

exiftool -UserComment= -XPComment= /path/to/files/
Title: Re: Append Comment
Post by: mike1950r on January 15, 2022, 04:17:53 PM
Thanks StarGeek,

works excellent.

Cheers mike