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:
- turn on camera.
- rotate iphone right (so camera in landscape mode).
- take picture.
- 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
Post a Comment