ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: imthenachoman on January 12, 2019, 08:43:43 AM

Title: errors writing comment even though it works
Post by: imthenachoman on January 12, 2019, 08:43:43 AM
I have a bash script that is going through images and adding OR appending a comment. The command I am using is:

exiftool -comment="$fileNameOriginal" '-comment<$Comment '"$fileNameOriginal" -overwrite_original "$newFileName"

This is the output:

Warning: [minor] Tag 'Comment' not defined - Photo 001.jpg
Warning: No writable tags set from Photo 001.jpg
    1 image files updated


However, when I check, the comment is there.

$ exiftool -comment "$newFileName"
Comment                         : IMG 0001.jpg


I don't get the error if I run the command a second time.

$ exiftool -comment="$fileNameOriginal" '-comment<$Comment '"$fileNameOriginal" -overwrite_original "$newFileName"
    1 image files updated

$ exiftool -comment "$newFileName"
Comment                         : IMG 0001.jpg IMG 0001.jpg


Any way to ignore that first error saying comment is not defined?

And what does that second error mean? Why would I get it if the comment was written?
Title: Re: errors writing comment even though it works
Post by: Phil Harvey on January 12, 2019, 10:22:50 AM
You can ignore the minor warning with -m.

The other warning can only be ignored with -q -q, but that will also remove the informational messages.  It means that you were trying to copy tags from a file (the source file), but nothing was copied.  This will happen if comment doesn't already exist.

- Phil
Title: Re: errors writing comment even though it works
Post by: imthenachoman on January 14, 2019, 11:38:28 PM
Got it. Thank you!