views:

37

answers:

1

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?

+1  A: 

No, UIImagePickerController cannot do it explicitly.

If you want to determine based on image's content. It is kind of hard problem. How can you determine an image's orientation without understanding the content inside of it?

I can suggest you a trick that you examine the width and the length of the returned image and see if it is portrait or landscape. For rotating the image, there are some libraries and codes outside but I didn't try them much. You can take a look at this blog

vodkhang
Thanks for the link. How would I obtain height and width of the image?
Bryan
After reading your link, I might not need the orientation because the resizing methods on the provided in the link will preserve orientation info and a UIImageView can compensate for orientation automatically.
Bryan