iOS JPEG images rotated 90 degrees

天涯浪子 提交于 2020-01-23 08:39:07

问题


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 ?


回答1:


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



来源:https://stackoverflow.com/questions/19906665/ios-jpeg-images-rotated-90-degrees

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!