更改图像的日期

时间:2017-08-03 14:39:22

标签: android

如何更改图片元数据中的日期?

示例:将图像从存储上传到应用并更改元数据(日期和时间)并将其保存为新日期。

1 个答案:

答案 0 :(得分:2)

您可以使用ExifInterface保存文件的属性

你可以这样做,

ExifInterface source = new ExifInterface(sourcePath);
source.setAttribute(ExifInterface.TAG_DATETIME_ORIGINAL, "[Date here]");
source.setAttribute(ExifInterface.TAG_DATETIME, "[Date here]");
source.saveAttributes();

有关属性标记的完整列表,您可以参考android.media.ExifInterface