From a9a27133b96675c88d1fefe44339625bb08fe6fe Mon Sep 17 00:00:00 2001
From: Bruno Windels <brunow@element.io>
Date: Thu, 26 Nov 2020 09:49:25 +0100
Subject: [PATCH] fix #204

---
 src/platform/web/dom/ImageHandle.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/platform/web/dom/ImageHandle.js b/src/platform/web/dom/ImageHandle.js
index c8b08e04..8676364c 100644
--- a/src/platform/web/dom/ImageHandle.js
+++ b/src/platform/web/dom/ImageHandle.js
@@ -44,8 +44,8 @@ export class ImageHandle {
     async scale(maxDimension) {
         const aspectRatio = this.width / this.height;
         const scaleFactor = Math.min(1, maxDimension / (aspectRatio >= 1 ? this.width : this.height));
-        const scaledWidth = this.width * scaleFactor;
-        const scaledHeight = this.height * scaleFactor;
+        const scaledWidth = Math.round(this.width * scaleFactor);
+        const scaledHeight = Math.round(this.height * scaleFactor);
 
         const canvas = document.createElement("canvas");
         canvas.width = scaledWidth;