/ps_rotatePhoto

rotate photo from html file input element

Primary LanguageJavaScript

在其他地方找到更好的解决方案:
=============================
https://github.com/gokercebeci/canvasResize



介绍
====
在web 开发中,因为在移动端拍照的时候,input 返回的照片往往不是拍照时候的方向,就做了这个模块,自动调整照片方向  
  
使用
====
使用zepto,require,和exif 等库  
跟俊照片exif 信息判断拍照方向,然后根据配置参数生成4个方向旋转后的img 对象  
自定义长边和短边,如果只设置一边,则另外一边会按比例调整  

demo
=====
```javascript
rotatePhotoM.init({
    inputElement:/**/,
    image:/**/,
    orientation:-1,//0 1 2 -1  一共4个方向
    shortSide:250,
    // longSide:300,
    callback:function(){
      // do some thing
    }
})
```