0

i am selecting image from imagepickercontroller and diplaying in an imageview.however for images taken from the camera ,they always appear 90 left in the device.for the images i take in the simulator they have the correct orientation.how to correct this.should i specify any orientation for images

sujith1406
  • 2,822
  • 6
  • 40
  • 60
  • Try the code in the following link. http://stackoverflow.com/questions/538041/uiimagepickercontroller-camera-preview-is-portrait-in-landscape-app/538064#538064 – EmptyStack Mar 31 '11 at 13:24

2 Answers2

1

I ran into the same issue myself. The way I solved it was to check the images orientation and then rotate it if it was supposed to be landscape.

The code I used was:

float orientation = [[myPhotoAsset valueForProperty:@"ALAssetPropertyOrientation"] floatValue];

if (orientation == 3)
    photo = [self CGImageRotatedByAngle:photo angle:-90];

Cheers

Brenton Morse
  • 2,567
  • 4
  • 21
  • 16
0

I had the same issue but finally I solved it with the following code:

UIImage*Image=[UIImage imageWithCGImage:[[asset defaultRepresentation] fullScreenImage]];