JS Client-Side Exif Orientation: Rotate and Mirror JPEG Images

前端 未结 12 906
花落未央
花落未央 2020-11-22 11:59

Digital camera photos are often saved as JPEG with an EXIF \"orientation\" tag. To display correctly, images need to be rotated/mirrored depending on which orientation is se

12条回答
  •  遇见更好的自我
    2020-11-22 12:19

    The github project JavaScript-Load-Image provides a complete solution to the EXIF orientation problem, correctly rotating/mirroring images for all 8 exif orientations. See the online demo of javascript exif orientation

    The image is drawn onto an HTML5 canvas. Its correct rendering is implemented in js/load-image-orientation.js through canvas operations.

    Hope this saves somebody else some time, and teaches the search engines about this open source gem :)

提交回复
热议问题