From 34ba6d1ca2ed5075dbf497bd1bc3891ef4867b06 Mon Sep 17 00:00:00 2001 From: EJShim Date: Tue, 6 Jul 2021 14:31:39 +0900 Subject: [PATCH] Should be able to convert non-squared image into imagedata --- Sources/Common/Core/ImageHelper/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Common/Core/ImageHelper/index.js b/Sources/Common/Core/ImageHelper/index.js index 3d7898b5509..6394e59372b 100644 --- a/Sources/Common/Core/ImageHelper/index.js +++ b/Sources/Common/Core/ImageHelper/index.js @@ -58,7 +58,7 @@ function imageToImageData( ctx.translate(canvas.width / 2, canvas.height / 2); ctx.scale(flipX ? -1 : 1, flipY ? -1 : 1); ctx.rotate((rotate * Math.PI) / 180); - ctx.drawImage(image, -image.width / 2, -image.width / 2); + ctx.drawImage(image, -image.width / 2, -image.height / 2); return canvasToImageData(canvas); }