-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[iOS] Fix compression resize resulting in blank image #2075
base: master
Are you sure you want to change the base?
Conversation
Hey Mark! Thanks for submitting your solution. There's a small tweak that I noticed - you need to pass the created
That way it works for me. |
ios/src/Compression.m
Outdated
@@ -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]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UIGraphicsImageRenderer *renderer = [[UIGraphicsImageRenderer alloc] initWithSize:newSize]; | |
UIGraphicsImageRenderer *renderer = [[UIGraphicsImageRenderer alloc] initWithSize:newSize format:format]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, must have been asleep at the wheel that day. Glad it helped you.
a9577dc
to
fe298cf
Compare
Is this going to be merged soon ? |
Fixes #2074