Metadata I Really Ought to Keep

Started by AndrewB, March 27, 2023, 09:09:24 AM

Previous topic - Next topic

AndrewB

I am looking to strip "as much metadata as possible" from a few thousand images.

From what I have read here, and elsewhere, it is considered a "Bad Idea" to strip ALL metadata from a file.
  exiftool -all:all=
 
The reccomendation appears to be to retain at least the ICC profile (in my case, always sRGB):
 exiftool -all:all= --ICC_Profile:all
 
Are there any other fields, or groups, which it is generally considered wise to retain?

One that has caught my attention is ExifIFD:ColorSpace as this appears to be pointing to the sRGB ICC profile (but perhaps that is a coincidence)

I further note that if I retain ExifIFD:ColorSpace I get a bunch of other ExifIFD fields automatically retained along with it:
  ExifIFD:ComponentsConfiguration, ExifIFD:ExifVersion, ExifIFD:FlashpixVersion
I assume these are compulsory?

Thanks.


Phil Harvey

#1
This is the command I would recommend:

exiftool -ext jpg -all= --icc_profile:all -tagsfromfile @ -colorspacetags DIR

If any color space tags are copied back then ExifTool will generate default compulsory tags as necessary when the new EXIF is created.

I've added the -ext jpg to be sure other file types aren't processed since this operation should only be done on JPG files.

- Phil

Edit: I've added a new FAQ 32 for this.
...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 ($).

AndrewB

Quote from: Phil Harvey on March 27, 2023, 09:32:33 AMI've added a new FAQ 32 for this.

A whole FAQ, just for me, I'm honoured.

But, with the proviso that certain fields in TIF files are entangled with the image and require special handling "-CommonIFD0=", how badly am I going to regret it if I apply your command to TIF files (published by lightroom if it makes any difference)?

Phil Harvey

I think this should be OK for common TIFF files, but may not remove all metadata.

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

AndrewB

Thanks Phil,

Being reassured that it probably won't explode - I shall press on with my testing.