Search code examples
iosuiimagepickercontrollerexif

iOS wrong orientation when using front camera on 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.

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?


Solution

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