Recently in an Android applet, you need to set the image generation time to EXIF datetime, with Exifinterface.setAttribute(ExifInterface.TAG_DATETIME,"2014/12/12 12:12:12")这种设置方式没有用,程序执行没有任何错误,也没有任何作用,设置不成功,到AndroidAPI的官网查也没有任何说明。
Can only turn to Google Teacher (fortunately in overseas, still can check), finally found this article. http://www.media.mit.edu/pia/Research/deepview/exif.html, the format of Exif has a clear record, wherein the DATETIME has the following description,
| 0x0132 |
Datetime |
ASCII string |
20 |
Date/time of image is last modified. Data format is ' YYYY:MM:DD HH:MM:SS ' +0x00, Total 20bytes. In usual, it has the same value of datetimeoriginal (0x9003) |
That is, DateTime must be set to the style "YYYY:MM:DD HH:MM:SS".
In this way, the program just executed without any effect is modified to: Exifinterface.setAttribute(ExifInterface.TAG_DATETIME,"2014:12:12 12:12:12")就可以把时间信息存入图像的Exif信息了。
About the origin of EXIF information, you can refer to the following articles:
Http://zh.wikipedia.org/wiki/EXIF
Use Exifinterface to set datetime problems