如何获得理想的Java数码照片容器的有效载荷的哈希值? [英] How do I obtain a hash of the payload of a digital photo container, ideally in Java?

查看:93
本文介绍了如何获得理想的Java数码照片容器的有效载荷的哈希值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经编辑了数字图片上的EXIF属性,并希望能够将它们标识为相同.我认为这意味着提取有效负载流并计算哈希.最好的方法是用Java语言,最好是使用本机实现提高性能的Java.

I have edited EXIF properties on digital pictures, and would like to be able to identify them as identical. I believe this implies extracting the payload stream and computing a hash. What is the best way to do this, ideally in the Java language, most ideally in Java using a native implementation for performance.

推荐答案

JPEG文件是一系列段".有些包含图像数据,有些则不包含.

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

Exif数据存储在APP1段中.您可以编写一些代码来比较 other 段,并查看它们是否匹配.哈希在这里似乎是一种合理的方法.例如,您可以比较仅SOI,DQT或DHT段的哈希.您需要进行实验,看看其中哪个效果最好.

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.

从我的元数据提取器库中检出JpegSegmentReader类.

  • Java: https://github.com/drewnoakes/metadata-extractor
  • .NET: https://github.com/drewnoakes/metadata-extractor-dotnet

使用该类,您可以从JPEG中提取特定段进行处理.

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

让我们知道您的生活吧!

Let us know how you get on!

这篇关于如何获得理想的Java数码照片容器的有效载荷的哈希值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆