1.方法一 使用 exif-js 解决
2.方法二 简短粗暴式 判断当前系统是否为ios,对图片进行旋转
以混合框架uni-app为例
//判断平台
this.platform = uni.getSystemInfoSync().platform
<view class="img">
<image :class="platform == 'ios' ? 'trans' : 'upload'" :src="formData.facePic"/>
</view>
.img {
flex: 0 50%;
height: 100%;
overflow: hidden;
box-sizing: border-box;
}
.upload {
width: 100%;
height: 245px;
box-sizing: border-box;
}
.trans {
width: 245px;
height: 100%;
box-sizing: border-box;
transform: rotate(90deg);
transform-origin: center;
position: relative;
left: -2px;
}