EXIFのOrientationをコマンドラインで取得・更新する
やりかた
# EXIF Orientation取得 $ exiftool -Orientation hoge.jpg # EXIF Orientation更新 $ exiftool -Orientation="Horizontal" hoge.jpg
※事前にexiftoolをインストールしておく必要があります。macの場合はbrew install exiftool
おまけ
ディレクトリにあるjpg画像*1ファイル全てに対して、
EXIF Orientationが設定されていないファイルに"Horizontal"を一括設定するBashワンライナー
$ for file in `ls *.jpg`; do if [ "$(exiftool -Orientation $file)" = "" ]; then exiftool -Orientation="Horizontal" $file ; fi ; done