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 Aug 2, 2024
1 parent 4d9cb70 commit fe298cf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ios/src/Compression.m
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ - (ImageResult*) compressImageDimensions:(UIImage*)image
}
CGSize newSize = CGSizeMake(newWidth, newHeight);

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

0 comments on commit fe298cf

Please sign in to comment.