iOS JPEG图像旋转90度 [英] iOS JPEG images rotated 90 degrees
本文介绍了iOS JPEG图像旋转90度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用选择器视图从相册中选择图像。我使用上面的代码:
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);
但此图像旋转了90度。只有肖像照片旋转。
我该如何解决这个问题?
But this image rotated 90 degrees. Only portrait photo rotated. How can i solve this problem ?
推荐答案
UIImage
有一个 imageOrientation
属性,可以用来检查和解决问题。找到这个链接。
UIImage
has a imageOrientation
property which can be used to check and resolve the issue.Find this link.
这篇关于iOS JPEG图像旋转90度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文