From 28ba0c2c13b7f19152c482d40928e92e18d6dfdf Mon Sep 17 00:00:00 2001 From: xsx <825657193@qq.com> Date: Thu, 31 Jul 2025 17:36:18 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=86=E8=8A=82=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../implatform/service/impl/FileServiceImpl.java | 6 ++++-- .../components/long-press-menu/long-press-menu.vue | 14 ++++++++++---- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/im-platform/src/main/java/com/bx/implatform/service/impl/FileServiceImpl.java b/im-platform/src/main/java/com/bx/implatform/service/impl/FileServiceImpl.java index 171bef7..150bc2c 100644 --- a/im-platform/src/main/java/com/bx/implatform/service/impl/FileServiceImpl.java +++ b/im-platform/src/main/java/com/bx/implatform/service/impl/FileServiceImpl.java @@ -106,8 +106,10 @@ public class FileServiceImpl extends ServiceImpl imple UploadImageVO vo = new UploadImageVO(); // 获取图片长度和宽度 BufferedImage bufferedImage = ImageIO.read(file.getInputStream()); - vo.setWidth(bufferedImage.getWidth()); - vo.setHeight(bufferedImage.getHeight()); + if(!Objects.isNull(bufferedImage)){ + vo.setWidth(bufferedImage.getWidth()); + vo.setHeight(bufferedImage.getHeight()); + } // 如果文件已存在,直接复用 String md5 = DigestUtils.md5DigestAsHex(file.getInputStream()); FileInfo fileInfo = findByMd5(md5, FileType.IMAGE.code()); diff --git a/im-uniapp/components/long-press-menu/long-press-menu.vue b/im-uniapp/components/long-press-menu/long-press-menu.vue index cedf6d2..8760ecd 100644 --- a/im-uniapp/components/long-press-menu/long-press-menu.vue +++ b/im-uniapp/components/long-press-menu/long-press-menu.vue @@ -1,6 +1,6 @@