[EDIT #1 by OP: Turns out this question is quite well answered by exiftool creator/maintainer Phil Harvey in a duplicate thread on the ExifTool Forum]
[EDIT #2 by OP: From ExifTool FAQ: ExifTool is not guaranteed to remove metadata completely from a file when attempting to delete all metadata. See 'Writer Limitations'.]
I'd like to search my old hard drives for photos that are not on my current backup drive. Formats include jpg, png, tif, etc..., as well as various raw formats (different camera models and manufacturers).
I'm only interested in uniqueness of the image itself and not uniqueness due to differences in, say, the values of exif tags, the presence/absence of a given exif tag itself, embedded thumbnails, etc ...
Even though I don't expect to find any corruption/data-rot between different copies of otherwise identical images, I'd like to detect that, as well as differences due to resizing and color changes.
[Edit #3 by OP: For clarification: A small percentage of false positives is tolerable (a file is concluded to be unique when it isn't) and false negatives are highly undesirable (a file is wrongly concluded to be a duplicate).]
My plan is to identify uniqueness based on md5sums after stripping any and all metadata.
How can I strip the metadata?
Will exiftool -all= <filename>
suffice?
file
will fail to discover RAW image formats andfind
will only work on extensions (it may be useful to describe better what you have)find $dir -type f -regextype posix-extended -regex ".*\.(jpg|png|<...>|cr2|raw|raf|orf)"
where<...>
means a a bunch of other suffixes.convert image.jpg - | md5sum
(ImageMagick) give you appropriate MD5 sums.