簡體   English   中英

JPEG文件中的EXIF數據

[英]EXIF data in JPEG file

使用Android中的ExifInterface將自定義數據作為Exif data in a JPEG image file寫入Exif data in a JPEG image file

想在JPEG file write/add自定義tags/exif數據,如姓名,年齡等...現在我可以編寫默認值,如Geo location data, attributes etc...但我可以用JPEG編寫自定義數據使用ExifInterface (Android)圖像

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

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();

我仍然試圖找出允許哪些其他exif標簽,但是現在,這應該可以解決問題。

為此,請使用Android EXIF界面

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

  2. 使用此方法創建JPEG的新版本。 public void saveAttributes()

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM