JPEG文件中的EXIF数据

Ank*_*hah 14 java android exif

将自定义数据编写为Android中的Exif data in a JPEG image file使用ExifInterface

想在名称,年龄等write/add自定义tags/exif数据JPEG file...现在我能够写出默认值,Geo location data, attributes etc...但我可以使用JPEG图像编写自定义数据ExifInterface (Android)

这是否可能或任何其他替代方案,以保持图像的这些信息不足

bae*_*aek 13

Android的ExifInterface只允许您编写"已识别"的exif标记.您可以在链接中找到一些公认的exif标记:http://developer.android.com/reference/android/media/ExifInterface.html

但好消息是,Android API中没有提到更多exif标签.坏消息是,我还没有找到列出所有可用exif标签的库

经过几个小时的研究和实验,我发现以下标签有效:

"UserComment在"

因此,以下代码段将起作用:

String mString = "Your message here";     
ExifInterface exif = new ExifInterface(path_of_your_jpeg_file);
exif.setAttribute("UserComment", mString);
exif.saveAttributes();
Run Code Online (Sandbox Code Playgroud)

我仍然试图找出允许哪些其他exif标签,但是现在,这应该可以解决问题.


Tim*_*Tim 1

为此,请使用 Android EXIF 接口

  1. 使用此方法添加属性 public void setAttribute (String tag, String value)

  2. 使用此方法制作新版本的 JPEG。公共无效保存属性()