diff --git a/client/web/src/components/modals/ImageCropper.tsx b/client/web/src/components/modals/ImageCropper.tsx index 28b98486..09f1db6e 100644 --- a/client/web/src/components/modals/ImageCropper.tsx +++ b/client/web/src/components/modals/ImageCropper.tsx @@ -73,21 +73,20 @@ let fileUrlTemp: string | null = null; // 缓存裁剪后的图片url * @param crop 裁剪信息 * @param rotation 旋转角度 * @param fileName 文件名 + * @param maxSize 最大尺寸 * @returns 裁剪后的图片blob url */ function getCroppedImg( image: HTMLImageElement, crop: Area, rotation = 0, - fileName = 'newFile.jpeg' + fileName = 'newFile.jpeg', + maxSize = Infinity ): Promise { const canvas = document.createElement('canvas'); const ctx = canvas.getContext('2d'); if (!_isNil(ctx)) { - // 设定最大尺寸,可以提出来作为参数传入 - const maxSize = 256; - // 计算最大尺寸 const size = Math.min(crop.width, crop.height, maxSize);