4

I am using picker view to select image from photo album. I use above code:

-(void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info{

updateImage = [info objectForKey:UIImagePickerControllerOriginalImage];

[self.view addSubview:[MUtility sharedObject].loadingView ];

[self dismissViewControllerAnimated:YES completion:nil];

}

After that i upload to server and i use this code

NSData *imageData = UIImageJPEGRepresentation(updateImage, 0.1);

But this image rotated 90 degrees. Only portrait photo rotated. How can i solve this problem ?

SukruK
  • 560
  • 2
  • 8
  • 22
  • 1
    Refer this answer, it will solve your problem. http://stackoverflow.com/questions/5427656/ios-uiimagepickercontroller-result-image-orientation-after-upload – hemkaran_raghav Nov 11 '13 at 12:53
  • There another solution to this problem [here](http://stackoverflow.com/questions/20204495/mfmailcomposeviewcontroller-image-orientation) along with a lengthy explanation of what's going on. – Gallymon Nov 29 '13 at 04:27

1 Answers1

1

UIImage has a imageOrientation property which can be used to check and resolve the issue.Find this link.

Community
  • 1
  • 1
kaar3k
  • 994
  • 7
  • 15