How to draw photo with correct orientation in canvas after capture photo by using input[type='file'] in mobile web browser?

后端 未结 5 1471
青春惊慌失措
青春惊慌失措 2020-12-07 08:33

I am making a simple web app in mobile which allow visitor to capture photo by using html5 input[type=file] element. Then I will display it on the web for preview, and then

5条回答
  •  無奈伤痛
    2020-12-07 09:15

    If you just want the Orientation tag, using exif.js:

    EXIF.getData(file, function () {
        alert(this.exifdata.Orientation);
    });
    

    In my tests, iOS camera only returns 1,3,6 or 8.

提交回复
热议问题