From 90930f904d77fda9a2ca03ef884fa4cd9da67c70 Mon Sep 17 00:00:00 2001 From: zhanglb Date: Wed, 20 Sep 2023 08:54:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=89=AA=E5=88=87=E3=80=81?= =?UTF-8?q?=E5=8E=8B=E7=BC=A9=E8=B7=AF=E5=BE=84=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../server/common/service/impl/FileUploadServiceImpl.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docus-api-common/src/main/java/com/docus/server/common/service/impl/FileUploadServiceImpl.java b/docus-api-common/src/main/java/com/docus/server/common/service/impl/FileUploadServiceImpl.java index 2d4145c..b5f9bf0 100644 --- a/docus-api-common/src/main/java/com/docus/server/common/service/impl/FileUploadServiceImpl.java +++ b/docus-api-common/src/main/java/com/docus/server/common/service/impl/FileUploadServiceImpl.java @@ -130,16 +130,17 @@ public class FileUploadServiceImpl implements IFileUploadService { public void compressFile(String compressPath,String picPath ,Double compressWidth) { if (Func.isNotBlank(compressPath)) { try { - File compressFile= new File(compressPath); + File compressFile= new File(compressPath); if (!compressFile.getParentFile().exists()) { compressFile.getParentFile().mkdirs(); } - File compressDest = new File(saveCompressFilePath); + File compressDest = new File(compressPath); BufferedImage image = ImageIO.read(new File(picPath)); int width = image.getWidth(); //图片压缩 ImgUtil.scale(image, FileUtil.file(compressDest), (float) (compressWidth / width)); }catch (Exception e){ + log.error(e.getMessage(), e); }finally { } } @@ -163,6 +164,7 @@ public class FileUploadServiceImpl implements IFileUploadService { //剪切 ImgUtil.cut(image, FileUtil.file(cutDest), new Rectangle(0, startY, width, endY)); }catch (Exception e){ + log.error(e.getMessage(), e); }finally { } }