up vote18down votefavorite 12 | Is it possible to setup UIImageView to handle image orientation? When I set the UIImageView to image with orientation RIGHT (it is photo from camera roll), the image is rotated to right, but I want to show it in proper orientation, as it was taken. I know I can rotate image data but it is possible to do it more elegant? Thank you ios uiimageview uiimage orientation
| ||
4 Answers
up vote54down voteaccepted | If I understand, what you want to do is disregard the orientation of the UIImage? If so then you could do this: UIImage *originalImage = [... whatever ...]; So you're creating a new UIImage with the same pixel data as the original (referenced via its CGImage property) but you're specifying an orientation that doesn't rotate the data.
| ||||||
| By the way, how can I actually rotate the image data? – Eno Mar 8 '12 at 7:19 | ||||||
up vote20down vote | As Anomie suggests in their answer here, this code will help to fix orientation: |