LoginSignup
5
5

More than 5 years have passed since last update.

ファイルの変更日時をExifの撮影日時に設定する

Posted at

スマホの写真をPCに取り込んだ場合などにファイルの変更日時が取り込んだ日時になることがあります。
WindowsだとF6 Exifなどで復元することができますがMacでも同様のことができないか調べてみるとExifToolで同様のことができました。

0. 環境

  • macOS Sierra 10.12
  • Homebrew
  • exiftool 10.20

1. ExifToolのインストール

HomebrewでExifToolをインストールします。

$ brew update
$ brew install exiftool

2. 変更日時を復元

あとは個々のファイルの撮影日時を変更日時に流し込みます。

$ find pic/ -type f -iname "*.jpg" -print0 | \
  xargs -0 exiftool "-filemodifydate<datetimeoriginal"

あるいは

$ exiftool "-filemodifydate<datetimeoriginal" pic/

x. 関連

5
5
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
5
5