Orientation 是记录手机拍摄照片方向的值,用来矫正照片,避免我们歪着脑袋看手机。
前端可以通过exif-js获取这个照片属性。
Orientation有八个值,从数字1~数字8
- top, left
- top, right
- bottom, right
- bottom, left
- left, top
- right, top
- right, bottom
- left, bottom
它们具体的区分如下图所示:

以上是查资料获取的值,但实际情况是这样么,那就自己动手吧。
我用vant做了个图片上传的页面,可以扫描下方二维码查看上传图片的信息。

如果不放心,可以手机直接访问https://www.hihj.cn/exif
结果如下图:

只试出了1、3、6、8这4种情况,剩下的2、4、5、7应该是图片翻转的效果,iphone默认相机没有这功能。
网友评论