Skip to content

Commit

Permalink
Set scale instead of generating at device resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
markholland committed Jul 19, 2024
1 parent 4d9cb70 commit a9577dc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ios/src/Compression.m
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ - (ImageResult*) compressImageDimensions:(UIImage*)image
}
CGSize newSize = CGSizeMake(newWidth, newHeight);

UIGraphicsImageRendererFormat *format = [UIGraphicsImageRendererFormat new];
format.scale = 1;
UIGraphicsImageRenderer *renderer = [[UIGraphicsImageRenderer alloc] initWithSize:newSize];
UIImage *resizedImage = [renderer imageWithActions:^(UIGraphicsImageRendererContext * _Nonnull rendererContext) {
[image drawInRect:CGRectMake(0, 0, newSize.width, newSize.height)];
Expand Down

0 comments on commit a9577dc

Please sign in to comment.