iOS wrong orientation when using front camera on U

2019-08-01 10:15发布

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?

2条回答
祖国的老花朵
2楼-- · 2019-08-01 10:38

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...

查看更多
Emotional °昔
3楼-- · 2019-08-01 10:47

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

查看更多
登录 后发表回答