Main Menu

Append Comment

Started by mike1950r, January 13, 2022, 04:16:21 PM

Previous topic - Next topic

mike1950r

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

Phil Harvey

Hi Mike,

This will do exactly what you asked:

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

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

mike1950r

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)

StarGeek

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 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
exiftool -if "$UserComment" "-UserComment<${UserComment} Add This" FILE
* 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).

Phil Harvey

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

StarGeek

True but it will give an error response and inexperience users tend to freak out about such things.
* 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).

mike1950r

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.


StarGeek

Quote from: mike1950r on January 15, 2022, 02:20:10 PM
How can I remove these all together:

exiftool -UserComment= -XPComment= /path/to/files/
* 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).

mike1950r

Thanks StarGeek,

works excellent.

Cheers mike