Calculating MD5 for RawImageDigest

Started by HBox, July 14, 2010, 05:56:16 AM

Previous topic - Next topic

simonmcnair

I see that there is an option for sha128 and 256.  Is it possible to use this from the command line please ?
https://exiftool.org/ExifTool.html#Options

I grasped at straws and tried:
exiftool "-OriginalImageHash<$imagedataSHA512" "C:\Users\Simon\Desktop\xh0o9gxe8soa1.jpg"

But it didn't work.
I just want a way of storing a hash that I know that I put there, and probably won't be modified by anything else.

simonmcnair

Maybe the question is:
Please can you tell me how to get exiftool to populate the XMP ExifTool Tags with sha256 values

StarGeek

You would use the -api option.  Specifically, you would add -api ImageHashType=SHA256.  This will calculate the image hash and the result would be in the ImageDataHash tag, which you would then have to copy to an embedded tag.  There is the OriginalImageHash and OriginalImageHashType tags for which you can write the hash and the api setting used.  Note that these are exiftool specific and it's unlikely that any other program can read these.

Example
exiftool -api ImageHashType=SHA256 "-OriginalImageHash<ImageDataHash" -OriginalImageHashType=SHA256 /path/to/files/
 
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

simonmcnair


krzysiu

That's funny, I was just looking for such ability a few hours ago. ChatGPT sent me on wild goose chase.
 
\/ False info, use information provided by other users

^ False info, use information provided by other users

My question is: where one could check all possible values for -api ImageHashType?
"We would use teleporters and live on another planets, if only ExifTool would be present when I was researching cosmos and physics"
Albert Einstein

StarGeek

People obviously shouldn't take anything ChatGPT says for granted (see Lawyers blame ChatGPT for tricking them into citing bogus case law), I've actually been a bit surprised by how often it is accurate.  Not perfect, but often a decent start, and rarely commits the mistake of looping exiftool (Common Mistake #3).

But then, it sometimes returns my signature "/path/to/files/" text I include in much of my commands, so I know it's been using some of my posts :D

There are plenty of people upset about how LLMs have scraped their text from the web, but in my case, everything I post here I consider public domain and if it helps someone with exiftool, I'm absolutely fine with that.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).