Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIImagePickerController Image Orientation

Can anyone tell me how to use the UIImagePickerController (camera and album) delegates determine the image's orientation, rotate accordingly, and assign it to a UIImageView?

like image 290
Bryan Avatar asked Feb 15 '26 05:02

Bryan


1 Answers

Vodkhang's answer is partially incorrect - modern cameras put an explicit orientation into the image when they take the photo. This has been common for about 5+ years now.

I've previously used the code in this answer to do the rotation by reading the "orientation" info direct from the picture:

UIImagePickerController camera preview is portrait in landscape app

like image 159
Adam Avatar answered Feb 16 '26 18:02

Adam



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!