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

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -