ExifTool Forum

ExifTool => Newbies => Topic started by: AndrewB on March 27, 2023, 09:09:24 AM

Title: Metadata I Really Ought to Keep
Post by: AndrewB on March 27, 2023, 09:09:24 AM
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.

Title: Re: Metadata I Really Ought to Keep
Post by: Phil Harvey on March 27, 2023, 09:32:33 AM
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 (https://exiftool.org/faq.html#Q32) for this.
Title: Re: Metadata I Really Ought to Keep
Post by: AndrewB on March 27, 2023, 11:39:44 AM
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)?
Title: Re: Metadata I Really Ought to Keep
Post by: Phil Harvey on March 27, 2023, 12:18:31 PM
I think this should be OK for common TIFF files, but may not remove all metadata.

- Phil
Title: Re: Metadata I Really Ought to Keep
Post by: AndrewB on March 27, 2023, 12:56:10 PM
Thanks Phil,

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