Generating MD5 Hash over image data?

Started by tlum, December 16, 2018, 11:26:14 AM

Previous topic - Next topic

tlum

I'm wondering if there is an easy way to generate an MD5 Hash over a files image data? Don't confuse file data with image data, files are containers. I've already generated MD5 Hashes on the files, that's easy enough with md5sum.

The problem is the image data may be identical while the containers metadata may have been altered after a duplication has occurred. For my purposes only the main image data is relevant. While it would be great if exiftool could spit out an MD5 Hash of the image data, it would be sufficient to be able to stream the image data to stdout. I'm not sure if any of this is possible at present.

TIA!

Phil Harvey

For JPEG images this may be done by stripping all metadata, ie)

exiftool a.jpg -all= -o - | md5

But this won't work for other formats.  ExifTool doesn't deal with image data per se, so it won't do exactly what you are asking.

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

tlum

Thanks, I try tools which are geared more towards reading the image streams than the container metadata.