From 2f846bdcabc2230d93740d49029ea1b0204975e5 Mon Sep 17 00:00:00 2001 From: Zhanying <2446962908@qq.com> Date: Thu, 11 Apr 2024 17:58:07 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-115482=20fix:=20=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E4=B8=AD=E6=8A=A5=E8=A1=A8=E5=9D=97=E5=8D=95?= =?UTF-8?q?=E5=85=83=E6=A0=BC=E6=8F=92=E5=85=A5=E5=9B=BE=E7=89=87=EF=BC=8C?= =?UTF-8?q?=E9=A2=84=E8=A7=88=E6=8A=A5=E9=94=99=EF=BC=8C=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E5=8D=A1=E6=AD=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../style/background/image/ImagePreviewPane.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/style/background/image/ImagePreviewPane.java b/designer-base/src/main/java/com/fr/design/style/background/image/ImagePreviewPane.java index bc4f3f41cc..f24fed4ba0 100644 --- a/designer-base/src/main/java/com/fr/design/style/background/image/ImagePreviewPane.java +++ b/designer-base/src/main/java/com/fr/design/style/background/image/ImagePreviewPane.java @@ -9,6 +9,7 @@ import com.fr.base.Style; import com.fr.design.gui.iscrollbar.UIScrollBar; import com.fr.general.ImageWithSuffix; +import com.fr.log.FineLoggerFactory; import com.fr.stable.CoreGraphHelper; import javax.swing.JComponent; @@ -92,9 +93,14 @@ public class ImagePreviewPane extends JComponent implements Scrollable, ImagePre isLoading = false; CoreGraphHelper.waitForImage(image); - imageWidth = image.getWidth(null); - imageHeight = image.getHeight(null); - + if (image.getFineImage() != null && image.getImage() != null) { + try { + imageWidth = image.getWidth(null); + imageHeight = image.getHeight(null); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } this.setToolTipText("Image Size: " + imageWidth + "x" + imageHeight + "px"); } fireChangeListener();