File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -53,10 +53,10 @@ - (ImageResult*) compressImageDimensions:(UIImage*)image
53
53
}
54
54
CGSize newSize = CGSizeMake (newWidth, newHeight);
55
55
56
- UIGraphicsBeginImageContext ( newSize) ;
57
- [image drawInRect: CGRectMake ( 0 , 0 , newSize.width, newSize.height)];
58
- UIImage *resizedImage = UIGraphicsGetImageFromCurrentImageContext () ;
59
- UIGraphicsEndImageContext () ;
56
+ UIGraphicsImageRenderer *renderer = [[UIGraphicsImageRenderer alloc ] initWithSize: newSize] ;
57
+ UIImage *resizedImage = [renderer imageWithActions: ^(UIGraphicsImageRendererContext * _Nonnull rendererContext) {
58
+ [image drawInRect: CGRectMake ( 0 , 0 , newSize.width, newSize.height)] ;
59
+ }] ;
60
60
61
61
result.width = [NSNumber numberWithFloat: newWidth];
62
62
result.height = [NSNumber numberWithFloat: newHeight];
You can’t perform that action at this time.
0 commit comments