From c0b9f23a7c2b8917959ecfe673dc1712261a659b Mon Sep 17 00:00:00 2001 From: Argo-AsicoTech Date: Sat, 12 Oct 2024 13:46:28 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E5=A2=9E=E5=8A=A0=20canvas=20?= =?UTF-8?q?=E9=94=80=E6=AF=81=E4=BB=A3=E7=A0=81=EF=BC=8C=E9=98=B2=E6=AD=A2?= =?UTF-8?q?=E5=86=85=E5=AD=98=E6=B3=84=E6=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BootstrapBlazor.ImageCropper/ImageCropper.razor.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/BootstrapBlazor.ImageCropper/ImageCropper.razor.js b/src/components/BootstrapBlazor.ImageCropper/ImageCropper.razor.js index d4a4bc3..3d22531 100644 --- a/src/components/BootstrapBlazor.ImageCropper/ImageCropper.razor.js +++ b/src/components/BootstrapBlazor.ImageCropper/ImageCropper.razor.js @@ -45,6 +45,7 @@ export function dispose(id) { } } export function crop(id, isRound = false) { + let ret = null; const cropper = Data.get(id); if (cropper != null) { cropper.crop(); @@ -52,8 +53,10 @@ export function crop(id, isRound = false) { if (isRound) { resultData = getRoundCanvas(resultData); } - return resultData.toDataURL("image/jpeg", 0.8); + ret = resultData.toDataURL("image/jpeg", 0.8); + resultData = null; } + return ret; } export function replace(id, url) {