PNG with two comments

Started by Aronai, April 04, 2022, 02:59:43 PM

Previous topic - Next topic

Aronai

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.

Phil Harvey

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 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
...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

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

     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
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

Phil Harvey

Thanks StarGeek, but you left out the crucial part of your quote:

    In particular, keywords are considered case-sensitive.

- 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

Heh, yep.  I stopped reading at "spelled exactly" part.  ;D
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype