ExifTool Forum

ExifTool => Bug Reports / Feature Requests => Topic started by: Aronai on April 04, 2022, 02:59:43 PM

Title: PNG with two comments
Post by: Aronai on April 04, 2022, 02:59:43 PM
I have a PNG created by Clip Studio Paint with the following tEXt chunk:

PNG tEXt (26 bytes):
  [adding COMMENT]
  COMMENT = Celsys Studio Tool


If I do exiftool -PNG:Comment file.png this block is displayed.
If I do exiftool -PNG:Comment="something" I end up with a PNG file with

PNG tEXt (26 bytes):
  [adding COMMENT]
  COMMENT = Celsys Studio Tool
PNG tEXt (29 bytes):
  Comment = something


So for the purpose of reading, it seems to consider the (somewhat strange) initial tEXt chunk to match PNG:Comment, for the purpose of updating PNG:Comment, it does not.
If I do exiftool -PNG:Comment= it will remove my 'something' comment. If I do it again, it will not consider there to be any matches for PNG:Comment in the file, another asymmetry from just reading PNG:Comment.

How can I properly update/remove these comments? They are removed if I do -PNG:All= but removing all PNG tags isn't ideal.

Addendum: To clarify, I tried PNG:COMMENT as well. It doesn't seem case-sensitive.
Title: Re: PNG with two comments
Post by: Phil Harvey on April 07, 2022, 09:33:42 AM
It seems  that Clip Studio Paint is using an incorrect uppercase tag ID.  (The "adding" message indicates that ExifTool is adding this to the internal tag table because it isn't a standard tag.)

To write this non-standard tag would require creating a user-defined tag.  See the sample config file (https://exiftool.org/config.html) for examples of how to do this for PNG TextualData tags.  You should give this tag a different name so you can distinguish it from the standard "Comment" tag.

- Phil
Title: Re: PNG with two comments
Post by: StarGeek on April 07, 2022, 12:05:29 PM
Quote from: Phil Harvey on April 07, 2022, 09:33:42 AM
It seems  that Clip Studio Paint is using an incorrect uppercase tag ID.

The relevant section of the specs on w3.org (https://www.w3.org/TR/PNG-Chunks.html#C.tEXt)

     The following keywords are predefined and should be used where appropriate:
<snip full list>
     Comment          Miscellaneous comment; conversion from GIF comment
...
     Keywords must be spelled exactly as registered
Title: Re: PNG with two comments
Post by: Phil Harvey on April 07, 2022, 12:39:49 PM
Thanks StarGeek, but you left out the crucial part of your quote:

    In particular, keywords are considered case-sensitive.

- Phil
Title: Re: PNG with two comments
Post by: StarGeek on April 07, 2022, 02:20:14 PM
Heh, yep.  I stopped reading at "spelled exactly" part.  ;D