LoginSignup
12
10

More than 3 years have passed since last update.

exiftoolでファイルの変更日時を写真の撮影日にする方法

Last updated at Posted at 2019-10-23

ファイルの変更日時(modify date)を写真の撮影日時に変更する方法です。

exiftoolというEXIF情報を扱えるCLIツールを入れます。

brew install exiftool

画像の日付情報を確認する方法:

$ exiftool -time:all -a -s CIMG2461.JPG
FileModifyDate                  : 2019:10:23 10:38:14+09:00
FileAccessDate                  : 2019:10:23 10:42:15+09:00
FileInodeChangeDate             : 2019:10:23 10:38:15+09:00
ModifyDate                      : 2015:03:15 09:21:53
DateTimeOriginal                : 2015:03:15 09:21:53
CreateDate                      : 2015:03:15 09:21:53

2015年撮影のものですが、ファイルの更新日が2019年になっています。

写真ファイルの更新日を撮影日に合わせる:

exiftool "-FileModifyDate<DateTimeOriginal" CIMG2461.JPG

これで、ファイルの更新日が変更されます。

ちなみに、ファイル名をワイルドカードで指定すれば、更新日変更を一括で行えます:

$ exiftool "-FileModifyDate<DateTimeOriginal" *.JPG
  882 image files updated
12
10
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
12
10