我想在我的 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/