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,802
  • 6
  • 39
  • 60

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,467
  • 4
  • 20
  • 16
0

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

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