How do I obtain a hash of the payload of a digital photo container, ideally in Java?

谁说胖子不能爱 提交于 2019-12-04 19:40:13

JPEG files are a series of 'segments'. Some contain image data, others don't.

Exif data is stored in the APP1 segment. You could write some code to compare the other segments, and see if they match. A hash seems like a reasonable approach here. For example, you might compare a hash of only the SOI, DQT or DHT segments. You'd need to experiment to see which of these gives the best result.

Check out the JpegSegmentReader class from my metadata-extractor library.

With that class you can pull out specific segment(s) from a JPEG for processing.

Let us know how you get on!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!