So, I was trying to write a script for myself to sanitise the EXIF metadata in images produced by my camera. I had a text file for a while with some tags that I should remove (like the camera serial number, etc.), but this became cumbersome and I wanted a fully scripted workflow.
I thought initially it's a simple exercise: look at the current tags,
decide either which one I wanted to remove (black-list) or
alternatively keep (white-list; preferred solution) and then call
exiftool with the appropriate options.
Boy oh boy… EXIF is just part of the equation. There are of course also the MakerNotes, which are manufacturer-specific and most of the time editable only as a block. Furthermore, there's no way to easily just duplicate each individual entry in this group to a standard EXIF or even XMP section, so basically you either keep to much or just give up a lot. Some of them can be copied to XMP, for example lens information, flash, etc. but white-balance (with the exiftool version that I have) is not, for example. Ideally I could just copy all maker notes to XMP, and then drop that entire group.
For the record, the way to drop all and just copy some is to run:
exiftool -all= -tagsfromfile @ -Orientation -AllDates …other tags… file.jpg
But do not add
"-makernotes", because that will bring the entire
The other fun thing is the number of thumbnails/preview images embedded. Looking at a random jpeg file, I found:
- a thumbnail image in the EXIF section, indeed small, around ~8KiB in size (160×120 pixels)
- a preview image in the MakerNotes section, somewhat bigger, around ~24KiB in size (570×375 pixels)
- a “large thumbnail (full HD equivalent)” in the MPF section, with an incredible size of ~756KiB (1632×1080)
Now, I doubt even the use of one thumbnail, but 3? And one being more than half a megabyte? Someone's going overboard at Nikon…
On the plus side, removing all thumbnails and sanitising the meta-data makes the jpeg files quite a bit smaller, which also means easier to share, at least; not sure if I want to actually clean the master copies (even though I keep the NEFs).