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
Asked
Active
Viewed 701 times
0
-
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 Answers
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
-
but i am not using the alassets frmwrk.i am using the uiimagepickercontroller. – sujith1406 Apr 01 '11 at 10:04
0
I had the same issue but finally I solved it with the following code:
UIImage*Image=[UIImage imageWithCGImage:[[asset defaultRepresentation] fullScreenImage]];

user3673300
- 1
- 1