From 100829298ced8dab2aa1020e80866b16856e8d5d Mon Sep 17 00:00:00 2001 From: Victor Seiji Hariki Date: Mon, 26 Dec 2022 10:35:33 -0300 Subject: [PATCH] fixes #124 System clipboard paste was not working correctly Signed-off-by: Victor Seiji Hariki --- js/ui/tool/select.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/js/ui/tool/select.js b/js/ui/tool/select.js index 5fd2cd5..c62cf14 100644 --- a/js/ui/tool/select.js +++ b/js/ui/tool/select.js @@ -592,11 +592,12 @@ const selectTransformTool = () => for (const item of items) { for (const type of item.types) { if (type.startsWith("image/")) { - item.getType(type).then((blob) => { + item.getType(type).then(async (blob) => { // Converts blob to image const url = window.URL || window.webkitURL; const image = document.createElement("img"); - image.src = url.createObjectURL(file); + image.src = url.createObjectURL(blob); + await image.decode(); tools.stamp.enable({ image, back: tools.selecttransform.enable,