#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];
网友评论