Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Checksum JPEG data (not the whole file)

Are there end-of-exif / end-of-xmp / end-of-iptc / start-of-data markers that I could use to get a checksum of just the data part of a jpg / jpeg (and other image formats)?

like image 561
coolaj86 Avatar asked Nov 15 '22 13:11

coolaj86


1 Answers

I think this question is related to this one Compute hash of only the core image data (excluding metadata) for an image, https://stackoverflow.com/a/10075170/890106 gives an element of answer if you're looking for code.

It might not works with all JPG variants though : some of them can embed multiple images (MPF / CIPA Multi-Picture Format, more informations at http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/MPF.html) and you might still have some metadata. Also, some software put an UID in the form of --[0-9A-F]+-- at the end of the file and it shouldn't be read. Safest solution if probably to checksum pixels (though you can still have influence of orientation, color profile, ..).

like image 89
u890106 Avatar answered Dec 06 '22 12:12

u890106