hack のためのネタ帳, etc,,,

EXIF の属性の 1 つで撮影時のカメラの向きの情報

参考になるページ等

CSS3 による Orientation の補正

jquery.exif.jsjquery-css-transform を用いて css3 の transform で回転させると以下のようになると思う。
.exifLoadEx(function(){
// alert($(this).exif("Orientation"));
  switch(parseInt($(this).exif("Orientation"))) {                             // @see http://hackmylife.net/archives/7400448.html
  case 1:                                                              break; // default
  case 2: $(this).css("transform", "rotateY(180deg)                "); break; //                hflip
  case 3: $(this).css("transform", "                rotateZ(180deg)"); break; // 180 deg cw
  case 4: $(this).css("transform", "rotateY(180deg) rotateZ(180deg)"); break; // 180 deg cw and hflip
  case 5: $(this).css("transform", "rotateY(180deg) rotateZ( 90deg)"); break; //  90 deg cw and hflip
  case 6: $(this).css("transform", "                rotateZ( 90deg)"); break; //  90 deg cw
  case 7: $(this).css("transform", "rotateY(180deg) rotateZ(270deg)"); break; // 270 deg cw and hflip
  case 8: $(this).css("transform", "                rotateZ(270deg)"); break; // 270 deg cw
  }
});
タグ

コメントをかく


「http://」を含む投稿は禁止されています。

利用規約をご確認のうえご記入下さい

Wiki内検索

フリーエリア

管理人/副管理人のみ編集できます