SukruK
SukruK

Reputation: 560

iOS JPEG images rotated 90 degrees

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 ?

Upvotes: 4

Views: 3117

Answers (1)

kaar3k
kaar3k

Reputation: 994

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

Upvotes: 1

Related Questions