Removing metadata

Started by Neal Krawetz, October 23, 2024, 11:23:22 AM

Previous topic - Next topic

Neal Krawetz

PNG:

`exiftool -all= file.png` does not remove unkown/optional blocks.
PNG uses capitalization to denote whether a chunk is required or optional.

     1st letter: uppercase is mandatory, lowercase is ancillary (optional)
     2nd letter: uppercase is public data, lowercase is private (unpublished)
     3rd letter: reserved, always uppercase.
     4th letter: "safe to copy", uppercase is unsafe, lowercase is safe.

I expected `-all=` to remove any non-mandatory chunk.

JPEG:
`exiftool -all= file.jpg`
I expected it to remove all unnecessary or unknown APP blocks. Basically, anything other than APP14 'Adobe' is optional. (Because Adobe can't follow standards, the self-named "Adobe" app block contains colorspace information necessary for rendering.)

Phil Harvey

Good suggestion.  I'll look into this.

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

Phil Harvey

OK. I think that ExifTool is doing the correct thing already.

PNG: With -all= ExifTool deletes all PNG iTXt, tEXt and zTXt chunks.  Other non-mandatory chunks like tRNS, bKGD, sRGB, cHRM, etc, etc affect the rendering of the image and shouldn't be deleted.  Are there any chunks other than the text chunks that you consider metadata?

JPG: I don't know if you were trying to make a point here, but this is what ExifTool already does.

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