2012-07-27 132 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