From ac1bbb39373011353ab70c916caff071c390b847 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 11 Feb 2021 11:15:20 +0100 Subject: [PATCH] ensure thumbnail dimensions are integer, fixes #203 --- src/matrix/net/MediaRepository.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/matrix/net/MediaRepository.js b/src/matrix/net/MediaRepository.js index 2e7ec438..7bd20cce 100644 --- a/src/matrix/net/MediaRepository.js +++ b/src/matrix/net/MediaRepository.js @@ -28,7 +28,7 @@ export class MediaRepository { if (parts) { const [serverName, mediaId] = parts; const httpUrl = `${this._homeServer}/_matrix/media/r0/thumbnail/${encodeURIComponent(serverName)}/${encodeURIComponent(mediaId)}`; - return httpUrl + "?" + encodeQueryParams({width, height, method}); + return httpUrl + "?" + encodeQueryParams({width: Math.round(width), height: Math.round(height), method}); } return null; }