I am trying to remove all meta data from JPEG files except common photo tags as listed with exiftool -common (camera model, shutter speed, aperture, ISO, etc.) lens model, color space and embedded ICC profile.

Using the answer from question exiftool: delete exif data but preserve some specific tags, the following commands are produced. The problem is that both of them result in removing shutter speed, aperture and the embedded ICC profile as can be verified using exiftool with the respective flags.

exiftool -all= -tagsFromFile @ -common -LensModel -ColorSpace -icc_profile:all original.JPG

exiftool -all= -tagsFromFile @ -common -aperture -ShutterSpeed -LensModel -ColorSpace -icc_profile:all original.JPG

They both produce warning:

Warning: Sorry, filesize is not writable

Are the commands malformed or is this an ExifTool bug? This behaviour is confirmed on ExifTool version 10.40.

  • 1
    Possible duplicate of exiftool: delete exif data but preserve some specific tags – flolilo Feb 17 '18 at 18:23
  • Using the answer from the referenced question, one gets the unexpected result pointed out in my question. – Kyselejsyreček Feb 17 '18 at 18:26
  • I shifted my answer to that question - I tested mine and it works. – flolilo Feb 17 '18 at 18:38
  • Also note that v10.40 is from january 2017 - v10.79 was released recently. The latest production release is v10.55 - in June 2017. – flolilo Feb 17 '18 at 18:45
  • 1
    would you mind switching over to my answer? I now edited it so -common is not needed any more. – flolilo Feb 17 '18 at 20:13

The Common shortcut tag is more of a data collection tag and it really isn't meant for copying info from one file to another (see Shortcut tags for list of tags is contains). Many of that tags covered by that shortcut are either filesystem tags (FileSize), MakerNotes tags (Quality), or Composite tags (Aperture, ShutterSpeed). In the case of FileSize, you obviously can't arbitrarily change the size of the destination file, thus the filesize is not writable error.

In the case of Makernotes tags, they cannot be copied or created individually. It has to be copied as a block with -MakerNotes. You may not have been trying to copy the Quality tag, but this point becomes relevant when it comes to Composite tags.

Composite tags aren't tags that are in the file. They are derived from multiple other tags. Aperture and ShutterSpeed are two examples. You can't copy them to another file because individually, they don't exist. You have to copy the tags that they're based upon. Aperture is based upon either FNumber or ApertureValue, depending upon which is actually in the file. ShutterSpeed is based upon ExposureTime, ShutterSpeedValue, and/or BulbDuration. To correctly "copy" Aperture and ShutterSpeed, you have to copy the above tags that they're based upon. And some of those tags may be only in the MakerNotes, so you would have to copy the entire Makernotes

ICC_Profile is considered an "unsafe" tag and will not be copied unless it is explicitly listed. You probably have to copy it as a block with -ICC_Profile if -ICC_Profile:all doesn't work as some of the individual tags in the ICC_Profile are not writable.

tl;dr: There's nothing wrong with the exiftool command, it just doesn't do what you think it does.

| improve this answer | |
  • liked the tl;dr: and Totally agree with it. – C0deDaedalus Feb 18 '18 at 9:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.