-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Thumbnail API is called with non-integer width #9690
Comments
Same. It seems it's caused by non-integer DPI scaling. I have GDK_SCALE and GDK_DPI_SCALE env vars set to 1.2 and this bug indeed happens. When I unset them everything works again. |
I don't have any I do have |
There are other variables for Qt: And just like you said, rounding width and height fixes the issue: diff --git a/src/content-repo.js b/src/content-repo.js
index 2a176515..8a5f9f06 100644
--- a/src/content-repo.js
+++ b/src/content-repo.js
@@ -51,10 +51,10 @@ module.exports = {
const params = {};
if (width) {
- params.width = width;
+ params.width = Math.round(width);
}
if (height) {
- params.height = height;
+ params.height = Math.round(height);
}
if (resizeMethod) {
params.method = resizeMethod; |
I have Given that Force Fonts DPI is set to
When Force Fonts DPI is disabled:
Regardless of which combination I use, the thumbnail never loads. |
Hmm, then it's not related. I was asking because it was never an issue (if memory serves me right) at work on a 1920x1080 display and I had thumbnails occasionally not loading at home on a 2560x1440 display with scaling enabled (1.2 just as yours). |
Maybe there's something else at play here, because my display resolution is I am usually on a |
Looks like I can reproduce this on my Besides Force Fonts DPI (on KDE), and Firefox's On my
|
I've finally managed to dig into the code and find out that it's just For me, I've patched both:
This should fix both riot-web and any other client which may be invoking |
Presuming fixed by matrix-org/matrix-react-sdk#3031 / matrix-org/matrix-js-sdk#929 |
Description
Using riot-web v1.1.0, I'm observing that the media thumbnail API is invoked with query parameters like this:
?width=1066.6666666666665&height=800
.Synapse responds with a 400 HTTP error response (
Query parameter b'width' must be an integer
), which results in no thumbnail rendering in the timeline.The event's content is like this:
The thumbnail API specifically calls for an integer, so having it respond with an error seems reasonable.
I'm guessing
matrix-js-sdk
'sgetHttpUriForMxc
is invoked with a non-integerwidth
parameter.Fixing both
riot-web
(to round its numbers) andmatrix-js-sdk
(to either implicitly force-round or throw an exception) is probably ideal.Log: not sent
Version information
For the web app:
The text was updated successfully, but these errors were encountered: