今回は、かなりコンピュータ向きのお話です。
いままで、撮影した写真の回転、縮小はIrfanviewを使用して手作業でやっていました。
画像の回転は、ポートレートとランドスケープの設定のために行い、画像の縮小(リサイズ)は、gooのブログでは1メガ以上の画像のアップロードができないため行ってました。でも、さすがに手作業はは面倒くさい。
なんとかバッチ処理ができないものかと考えました。
そこで、Imagemagicを使おうかなと。。。
理想は縦横自動判別で回転と縮小作業を同時に実施させることです。
Imagemagicは、Meadowをインストールした際に入れたものがあるので、そのまま利用しようとおもったのですが。。。。
画像の縦横位置を取得しようと、identifyを使用したのですが、ImageMagic-6.0.1でOrientationを取ろうとしても'Undefined'となってしまって、役に立ちません。
ImageMagicを6.2.8にしたら、きちんとOrientationが取得できるようになりました。
【画像の縦横方向の取得】
identify -format %[EXIF:Orientation] hogehoge.jpg
【取得した画像の縦横方向】
www.exif.orgのEXIF 2.2仕様から引用
1 = The 0th row is at the visual top of the image, and the 0th column is the visual left-hand side.
2 = The 0th row is at the visual top of the image, and the 0th column is the visual right-hand side.
3 = The 0th row is at the visual bottom of the image, and the 0th column is the visual right-hand side.
4 = The 0th row is at the visual bottom of the image, and the 0th column is the visual left-hand side.
5 = The 0th row is the visual left-hand side of the image, and the 0th column is the visual top.
6 = The 0th row is the visual right-hand side of the image, and the 0th column is the visual top.
7 = The 0th row is the visual right-hand side of the image, and the 0th column is the visual bottom.
8 = The 0th row is the visual left-hand side of the image, and the 0th column is the visual bottom.
これじゃ、わけがわからいので。。。絵に描いてみました。
さらに、convertコマンドで変換するときのコマンドラインも加えました。
通常のカメラであれば、使用されるOrientationは、1、3、6、8のどれかでしょう。

いままで、撮影した写真の回転、縮小はIrfanviewを使用して手作業でやっていました。
画像の回転は、ポートレートとランドスケープの設定のために行い、画像の縮小(リサイズ)は、gooのブログでは1メガ以上の画像のアップロードができないため行ってました。でも、さすがに手作業はは面倒くさい。
なんとかバッチ処理ができないものかと考えました。
そこで、Imagemagicを使おうかなと。。。
理想は縦横自動判別で回転と縮小作業を同時に実施させることです。
Imagemagicは、Meadowをインストールした際に入れたものがあるので、そのまま利用しようとおもったのですが。。。。
画像の縦横位置を取得しようと、identifyを使用したのですが、ImageMagic-6.0.1でOrientationを取ろうとしても'Undefined'となってしまって、役に立ちません。
ImageMagicを6.2.8にしたら、きちんとOrientationが取得できるようになりました。
【画像の縦横方向の取得】
identify -format %[EXIF:Orientation] hogehoge.jpg
【取得した画像の縦横方向】
www.exif.orgのEXIF 2.2仕様から引用
1 = The 0th row is at the visual top of the image, and the 0th column is the visual left-hand side.
2 = The 0th row is at the visual top of the image, and the 0th column is the visual right-hand side.
3 = The 0th row is at the visual bottom of the image, and the 0th column is the visual right-hand side.
4 = The 0th row is at the visual bottom of the image, and the 0th column is the visual left-hand side.
5 = The 0th row is the visual left-hand side of the image, and the 0th column is the visual top.
6 = The 0th row is the visual right-hand side of the image, and the 0th column is the visual top.
7 = The 0th row is the visual right-hand side of the image, and the 0th column is the visual bottom.
8 = The 0th row is the visual left-hand side of the image, and the 0th column is the visual bottom.
これじゃ、わけがわからいので。。。絵に描いてみました。
さらに、convertコマンドで変換するときのコマンドラインも加えました。
通常のカメラであれば、使用されるOrientationは、1、3、6、8のどれかでしょう。

※コメント投稿者のブログIDはブログ作成者のみに通知されます