Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
688 views
Welcome To Ask or Share your Answers For Others

1 Answer

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...