You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The initial image added has a size of 1170x2532px. Since the image height exceeds 2000, it should be resized, with the width adjusted proportionally. The result size should be about 924x2000px.
Actual behaviour
The image is being resized up instead of down. The final image size becomes 2772x6000 px, meaning the height is actually "resized" to 2000 and then multiplied by 3x. I know the cause of this behavior and will explain it here.
Steps to reproduce
Use library version v0.41.x.
Set compressImageMaxWidth and compressImageMaxHeight.
Attempt to add an image with a width and/or height that exceeds these values to trigger the "compression" process and make the bug appear.
Attachments
As noted in this issue, this bug was introduced with this commit.
The problem is that when UIGraphicsImageRenderer is created, it uses a default scale parameter (reference) of 3.0 or 2.0, depending on the device (in my case, it's 3.0 on the iPhone 14) link.
This results in two issues:
If an image is resized, it ends up with incorrect dimensions.
For larger images, an error occurs: iosurface is too large for GPU, because an image that is scaled up 2–3 times (depending on the scale) cannot be processed, as it probably exceeds GL_MAX_TEXTURE_SIZE.
Version
Platform
Expected behaviour
The
openPicker
options are set as follows:compressImageMaxWidth
is set to2000
compressImageMaxHeight
is set to2000
The initial image added has a size of
1170x2532
px. Since the image height exceeds 2000, it should be resized, with the width adjusted proportionally. The result size should be about924x2000
px.Actual behaviour
The image is being resized up instead of down. The final image size becomes
2772x6000
px, meaning the height is actually "resized" to 2000 and then multiplied by 3x. I know the cause of this behavior and will explain it here.Steps to reproduce
Attachments
As noted in this issue, this bug was introduced with this commit.
The problem is that when
UIGraphicsImageRenderer
is created, it uses a default scale parameter (reference) of 3.0 or 2.0, depending on the device (in my case, it's 3.0 on the iPhone 14) link.This results in two issues:
iosurface is too large for GPU
, because an image that is scaled up 2–3 times (depending on the scale) cannot be processed, as it probably exceedsGL_MAX_TEXTURE_SIZE
.This PR #2075 should probably resolve the issue.
The text was updated successfully, but these errors were encountered: