From 9c3534dad88f1235662c97c78b2c7f2b55773cbb Mon Sep 17 00:00:00 2001 From: hezhihang Date: Wed, 6 Nov 2024 20:12:16 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E5=9B=BE=E7=89=87=E8=A3=81?= =?UTF-8?q?=E5=89=AA=E6=97=B6=E4=BC=98=E5=85=88=E5=8E=9F=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/amis/src/renderers/Form/InputImage.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/amis/src/renderers/Form/InputImage.tsx b/packages/amis/src/renderers/Form/InputImage.tsx index 0c0cdfda9..4c8a49b62 100644 --- a/packages/amis/src/renderers/Form/InputImage.tsx +++ b/packages/amis/src/renderers/Form/InputImage.tsx @@ -1107,6 +1107,7 @@ export default class ImageControl extends React.Component< handleCrop() { const {cropFormat, cropQuality} = this.props; + const originFormat = this.state.cropFile?.type || 'image/png'; this.cropper.getCroppedCanvas().toBlob( (file: File) => { this.addFiles([file]); @@ -1116,7 +1117,7 @@ export default class ImageControl extends React.Component< lockedReason: '' }); }, - cropFormat || 'image/png', + cropFormat || originFormat, cropQuality || 1 ); }