iOS在UIImagePickerController上使用前置摄像头时方向错误 [英] iOS wrong orientation when using front camera on UIImagePickerController

查看:176
本文介绍了iOS在UIImagePickerController上使用前置摄像头时方向错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用UIImagePickerController捕捉图像并将其上传到服务器.

I'm using UIImagePickerController to snap an image and uploading it to server.

在前置摄像头中拍摄照片时,高度/宽度在某处相反.

When taking a photo in the front camera, the height/width get reversed somewhere.

稍后可以正确显示图像,但是高度和宽度却颠倒了(我将它们用于UIImageView自动布局约束)

The image is displayed correctly later, but height and width are reversed (and I'm using them for the UIImageView autolayout constraint)

问题是-在查看前后摄像机图像的UIImagePickerControllerMediaMetadata时-EXIF和其余元数据相同(分辨率较小,但高宽比相同)

The thing is - that when looking at UIImagePickerControllerMediaMetadata of front and back camera images - the EXIF and the rest of the metadata is the same (resolution is smaller but the height/width ratio is the same)

任何想法有什么区别?

推荐答案

Apple图像始终横向留有EXIF,并且在EXIF中指定了方向.

Apple images are always landscape left with EXIF and the orientation is specified in the EXIF.

这篇关于iOS在UIImagePickerController上使用前置摄像头时方向错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆