goo blog サービス終了のお知らせ 

蘭を育てる

洋蘭やら東洋蘭やら、野生蘭を育ててる毎日のブログ

楽々画像変換

2006-06-11 00:51:31 | Weblog
今回は、かなりコンピュータ向きのお話です。

いままで、撮影した写真の回転、縮小は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のどれかでしょう。



コメント    この記事についてブログを書く
  • X
  • Facebookでシェアする
  • はてなブックマークに追加する
  • LINEでシェアする
« いや~。 | トップ | 楽々画像変換2 »
最新の画像もっと見る

コメントを投稿

サービス終了に伴い、10月1日にコメント投稿機能を終了させていただく予定です。

Weblog」カテゴリの最新記事