Use Exifinterface to set datetime problems

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.