From 7e265ba0dd211edd96a570870713a7c65675db98 Mon Sep 17 00:00:00 2001 From: Anthony Stirling <77850077+Frooodle@users.noreply.github.com.> Date: Fri, 8 Aug 2025 14:33:08 +0100 Subject: [PATCH] fixes --- .../software/common/util/ImageProcessingUtils.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/common/src/main/java/stirling/software/common/util/ImageProcessingUtils.java b/app/common/src/main/java/stirling/software/common/util/ImageProcessingUtils.java index 769f91cc8..fd4091d4c 100644 --- a/app/common/src/main/java/stirling/software/common/util/ImageProcessingUtils.java +++ b/app/common/src/main/java/stirling/software/common/util/ImageProcessingUtils.java @@ -121,7 +121,6 @@ public class ImageProcessingUtils { BufferedImage image = null; String filename = file.getOriginalFilename(); - // Try different approaches for different file types if (filename != null && filename.toLowerCase().endsWith(".psd")) { // For PSD files, try explicit ImageReader Iterator readers = ImageIO.getImageReadersByFormatName("PSD"); @@ -134,16 +133,17 @@ public class ImageProcessingUtils { reader.dispose(); } } - } - - // Fallback to standard ImageIO.read for all files (including PSD if explicit reader failed) - if (image == null) { + if (image == null) { + throw new IOException("Unable to read image from file: " + filename + + ". Supported PSD formats: RGB/CMYK/Gray 8-32 bit, RLE/ZIP compression"); + } + } else { + // For non-PSD files, use standard ImageIO image = ImageIO.read(file.getInputStream()); } if (image == null) { - throw new IOException("Unable to read image from file: " + filename + - ". Supported PSD formats: RGB/CMYK/Gray 8-32 bit, RLE/ZIP compression"); + throw new IOException("Unable to read image from file: " + filename); } double orientation = extractImageOrientation(file.getInputStream());