【Amazon Photo】日付なしとなるファイルに予め日付を入れておく(Mac)【実績記録】

雑学

先人の知恵を拝借してうまくいったことを残す記事です。
まず、敬意を表し、参考にさせて頂いた記事から紹介させて下さい。

参考ページ紹介

ポイント

  • Amazon PhotoはExif情報から日付を判定しているようだ。
  • Exif情報はexiftoolで編集出来る。

exiftool実行メモ

Exif情報表示

$ exiftool -EXIF:All -H test.jpg
0x0112 Orientation                     : Horizontal (normal)
0x011a X Resolution                    : 72
0x011b Y Resolution                    : 72
0x0128 Resolution Unit                 : inches
0xa001 Color Space                     : sRGB
0xa002 Exif Image Width                : 3024
0xa003 Exif Image Height               : 3024

日付情報付与

$ exiftool -alldates="2024-08-30 00:00:00" ./test.jpg
    1 image files updated
$ exiftool -alldates="`date`" ./test.jpg
    1 image files updated

Interoperability Version付与(これもいるらしい)

$ exiftool -InteropVersion=0100 test.jpg
    1 image files updated

最終確認

$ exiftool -EXIF:All -H test.jpg        
0x0112 Orientation                     : Horizontal (normal)
0x011a X Resolution                    : 72
0x011b Y Resolution                    : 72
0x0128 Resolution Unit                 : inches
0x0132 Modify Date                     : 2024:08:30 13:15:09
0x9003 Date/Time Original              : 2024:08:30 13:15:09
0x9004 Create Date                     : 2024:08:30 13:15:09
0xa001 Color Space                     : sRGB
0xa002 Exif Image Width                : 3024
0xa003 Exif Image Height               : 3024
0x0002 Interoperability Version        : 0100

これで日付つきでAmazon Photoにアップロード出来ました。

シェルスクリプト

$ cat Tool.sh 

# パス情報
FILEPATH="XXX"

# 日付情報を上書き
exiftool -alldates="`date`" "${FILEPATH}/"*

# 上書き前の元情報削除
rm "${FILEPATH}/"*original

関連記事