IPhone : How to detect current orientation to rotate UIImage?

on Tuesday, March 31, 2015

I am implement taking photo function and I got an bellow issue.


After taking photo, I have to crop a thumbnail from original image to make avatar icon. But it's not good if user rotates the iPhone and take it. Step:




  1. Turn on camera.




  2. Rotate the iPhone to right ( it means landscape mode ).



  3. Take picture.

  4. I get UIImage with bad orientation. Therefore, thumbnail is not good.


How I can detect the orientation to rotate UIImage?


Thank you!


0 comments:

Post a Comment