java - 如何确认图像是用特定设备拍摄的?

标签 java android image exif

我想在我的 android 应用程序中编写函数来确认图片是 由特定移动设备拍摄。

今天我可以判断照片是否由特定型号拍摄。 (如银河 s3)。

但是,我想要的不止于此。 我想从图像 EXIF 唯一 ID 中获取并将其与设备唯一 ID 进行比较。

感谢您的帮助。

最佳答案

也许不用长代码。您可以为此使用预先准备好的库。

Metadata metadata = ImageMetadataReader.readMetadata(imageFile);

这是库使用的示例代码,https://drewnoakes.com/code/exif/

它会为您提供图像的元数据。这也是您想要的内容,例如 GeoLocation、CellularInformation、Resolution、Focus 和附加到图像的所有其他数据。

来自链接的引用

It understands several formats of metadata, all of which may be present in a single image: In addition it can decode values that are specific to particular camera manufacturers and models.

然后您可以检查该图像的详细信息并显示或隐藏或您想要对该图像执行的任何操作。

您也可以从 Google Code 获取代码:https://code.google.com/p/metadata-extractor/

祝你好运!

关于java - 如何确认图像是用特定设备拍摄的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23877330/

相关文章:

java - 查找 twitter4j 转发率限制

java - 使用 Gson 反序列化 unknow json

linux - 网络 : keeping extension images or not

java - 无法解密和读取加密的图像文件

c# - 如何找到两个图像之间的差异矩形

java - 递归调用方法时返回

java - Android:将相机图标添加到 android studio 上的操作栏

java - 使用 char 数组接收用户输入并使用数组逐个元素向用户显示

android - 在 android 服务中使用 NotificationManager

java - 两个相互连接的日期选择器同时调用两个监听器