-
Notifications
You must be signed in to change notification settings - Fork 781
Fixes large images crashing when opened in timeline #6290
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
Conversation
}) | ||
.fitCenter() | ||
.into(imageView) | ||
req.fitCenter().into(target) |
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.
to double check, this line is the fix? (everything else is removed unused code)
it's interesting that we were overriding the size to be non scaled instead of the default behaviour of scaling to match the View
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.
Indeed it was. I think the idea is full images get displayed with their full size, but this really doesn't have any real use since we have a limited view space and a limited zoom. The important thing is that they can still download the full image
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.
(I would have kept the previous formatting, better for git diff, or future change, but this is really a minor remark
req
.fitCenter()
.into(target)
)
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.
Happy to make the change 👍
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.
great catch and clean up! 💯
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.
LGTM, thanks.
}) | ||
.fitCenter() | ||
.into(imageView) | ||
req.fitCenter().into(target) |
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.
(I would have kept the previous formatting, better for git diff, or future change, but this is really a minor remark
req
.fitCenter()
.into(target)
)
Does it also close #1951 ? |
I performed the steps to confirm this would close https://github.com./matrix-org/internal-config/issues/1184:
|
Kudos, SonarCloud Quality Gate passed! |
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.
LGTM.
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.
LGTM
Closes #3603 |
Type of change
Content
Fixes large images crashing when opened in the timeline
Motivation and context
Closes #2642
Also closes #1951
Also closes #6190
Also closes https://github.com./matrix-org/internal-config/issues/1184
Error:
java.lang.RuntimeException: Canvas: trying to draw too large(111132000bytes) bitmap.
Caused when the image is rendered in
AttachmentViewerActivity
. We were overriding the size to scale the bitmap to be much larger than it already is. Upon investigation, this provides no benefit in increasing the quality of the opened image.An
onlyRetrieveFromCache
line was removed to as this prevented the image transition from happening and seems to give little benefit to performance.Some unused functions and old comments were also removed
Other checks performed:
Screenshots / GIFs
device-2022-06-13-120754.mp4
(app used to crash when clicking the image on the timeline)
Tests
Tested devices
Checklist