iOS 关于拍照照片旋转问题
作者:
Luyc_Han | 来源:发表于
2018-04-18 21:27 被阅读25次#pragma mark----解决图片自动旋转问题
- (UIImage *)normalizedImage:(UIImage *)image{
if (image.imageOrientation == UIImageOrientationUp){
return image;
}
UIGraphicsBeginImageContextWithOptions(image.size, NO, image.scale);
[image drawInRect:(CGRect){0, 0, image.size}];
UIImage *normalizedImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return normalizedImage;
}
使用
UIImage *currentImage = [self normalizedImage:currentImage];
本文标题:iOS 关于拍照照片旋转问题
本文链接:https://www.haomeiwen.com/subject/obibkftx.html
网友评论