2012-07-27 134 views
3

我正在开发一个android应用程序,我想读取和更新用户注释EXIF标记。 我只是无法在ExifInterface.java类中找到该标签。我可以在ExifInterface中创建一个自定义标签,说TAG_USER_COMMENT?如果是,我该如何创建它?或者我应该使用其他工具完成工作吗?更改用户注释EXIF标记(0x9286)

任何帮助将非常感激。

+0

工作如果Android不支持EXIF评论,怎么样正常JPEG评论(标签FFFE)? – BitBank 2012-08-04 22:18:04

回答

0

可以按如下编写一个叫做 “UserComment在” Exif标签的字符串数据:

`import android.media.ExifInterface;` 

File directory = new File(your directory goes here);

final File image = new File(directory, "name.jpg");

ExifInterface interface = new ExifInterface(image.getPath());

interface.setAttribute("UserComment", "your string here");

interface.saveAttributes();

然后你可以如下读取使用的getAttribute您的数据:

String my_data = interface.getAttribute("UserComment");

它不会对某些图像

+0

它不工作。 – Ajinkya 2017-01-23 07:58:30