ios - How to detect current orientation to rotate UIImage? -


i implement taking photo function , i'm having following issue.

after taking photo, have crop thumbnail original image make avatar icon. it's not if user takes photo in landscape.

step:

  1. turn on camera.
  2. rotate iphone right (so camera in landscape mode).
  3. take picture.
  4. i uiimage bad orientation. therefore, thumbnail not good.

how can detect orientation rotate uiimage?

try below code

if (image.size.width > image.size.height ) // landscape     {      } else   // portrait     {      } 

Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -