按给定时间更改照片元数据

按给定时间更改照片元数据

我的相机电池耗尽,存储的日期错误,现在我有大约 100 张照片的日期不正确。有没有什么应用程序可以更改照片的日期?有没有什么应用程序可以计算新日期 = (旧日期 - 1 天.2 个月.12 小时),这样我就不必计算差值并为每个文件输入日期了?

答案1

exiv2应该是最简单的解决方案:

exiv2 -O -2 -D -1 -a -12:00:00 adjust /path/to/copy/*.jpg

手册页摘录:

exiv2 - Image metadata manipulation tool 
exiv2 [options] [action] file ...

ad | adjust
    Adjust Exif timestamps by the given time. Requires at least one of the options -a time, -Y yrs, -O mon or -D day.

-a time
    Time adjustment in the format [-]HH[:MM[:SS]]. This option is only used with the 'adjust' action. Examples: 1 adds one hour, 1:01 adds one hour and one minute, -0:00:30 subtracts 30 seconds. 
-Y yrs
    Time adjustment by a positive or negative number of years, for the 'adjust' action. 
-O mon
    Time adjustment by a positive or negative number of months, for the 'adjust' action. 
-D day
    Time adjustment by a positive or negative number of days, for the 'adjust' action. 

另外,我建议您先在照片的副本上尝试此操作,而不是在原件上。

相关内容