From 2c124900ef70be14533973e312884545f00b68fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E5=AE=87=E5=A5=87?= Date: Wed, 26 Mar 2025 18:43:51 +0800 Subject: [PATCH] style --- .../com/ruoyi/xkt/service/impl/PictureServiceImpl.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xkt/src/main/java/com/ruoyi/xkt/service/impl/PictureServiceImpl.java b/xkt/src/main/java/com/ruoyi/xkt/service/impl/PictureServiceImpl.java index 0ad1edc19..0b0f831bc 100644 --- a/xkt/src/main/java/com/ruoyi/xkt/service/impl/PictureServiceImpl.java +++ b/xkt/src/main/java/com/ruoyi/xkt/service/impl/PictureServiceImpl.java @@ -61,12 +61,14 @@ public class PictureServiceImpl implements IPictureService { if (ImgExtUtil.isImageByMagicNumber(file)) { FileUtil.mkParentDirs(new450Path); FileUtil.mkParentDirs(new750Path); + int height; + int weight; //450p图片 try (InputStream is = new FileInputStream(file); FileOutputStream fos = new FileOutputStream(new450Path)) { BufferedImage in = ImageIO.read(is); - int height = in.getHeight(); - int weight = in.getWidth(); + height = in.getHeight(); + weight = in.getWidth(); int neww = 450; int newh = (int) (NumberUtil.div(height, weight, 5) * neww); ImgExtUtil.scale(in, fos, neww, newh, null); @@ -75,8 +77,6 @@ public class PictureServiceImpl implements IPictureService { try (InputStream is = new FileInputStream(file); FileOutputStream fos = new FileOutputStream(new750Path)) { BufferedImage in = ImageIO.read(is); - int height = in.getHeight(); - int weight = in.getWidth(); int neww = 750; int newh = (int) (NumberUtil.div(height, weight, 5) * neww); ImgExtUtil.scale(in, fos, neww, newh, null);