2013-03-19 50 views

回答

5

嘗試與標籤保存Exif數據:

「UserComment在」

代碼:

String mString = "Your message here";  
ExifInterface exif = new ExifInterface(path_of_your_jpeg_file); 
exif.setAttribute("UserComment", mString); 
exif.saveAttributes(); 

你可以把你在那裏想要的東西(如字符串),並簡單地分析字符串。我希望我們能夠創建和命名我們自己的exif標籤,但事實是我們不能。所以這是我想出的最佳解決方案。

+0

我試圖與ObjExifInterface.setAttribute( 「UserComment在」,指出: 「......」);但它不起作用。 – 2013-09-23 10:42:09

1

保存與標籤Exif數據"ImageDescription"

https://developer.android.com/reference/android/media/ExifInterface.html

代碼

try { 
    String imageDescription = "Your image description";  
    ExifInterface exif = new ExifInterface(file_name_of_jpeg); 
    exif.setAttribute("ImageDescription", imageDescription); 
    exif.saveAttributes(); 
} catch (IOException e) { 
    // handle the error 
}