您的位置:首页 > 其它

拍摄的照片上传之后旋转如何解决?

2015-11-23 14:06 281 查看
在上传之前先把图片调到正确的位置。

1 - (UIImage *)normalizedImage {
2     if (self.imageOrientation == UIImageOrientationUp) return self;
3
4     UIGraphicsBeginImageContextWithOptions(self.size, NO, self.scale);
5     [self drawInRect:(CGRect){0, 0, self.size}];
6     UIImage *normalizedImage = UIGraphicsGetImageFromCurrentImageContext();
7     UIGraphicsEndImageContext();
8     return normalizedImage;
9 }

详情参考:http://feihu.me/blog/2015/how-to-handle-image-orientation-on-iOS/
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: