iOS wrong orientation when using front camera on UIImagePickerController

自古美人都是妖i 提交于 2019-12-11 11:03:21

问题


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.

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

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)

Any ideas what is the difference?


回答1:


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




回答2:


OK, so @zaph comment is correct, apparently back camera images are "reversed" as well - the upload code in the server (Codeigniter PHP) ignored the EXIF.

The problem surfaced only due to front camera low resolution...



来源:https://stackoverflow.com/questions/29460610/ios-wrong-orientation-when-using-front-camera-on-uiimagepickercontroller

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!