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 fd4091d4c..7140b3cc2 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 @@ -120,7 +120,7 @@ public class ImageProcessingUtils { throws IOException { BufferedImage image = null; String filename = file.getOriginalFilename(); - + if (filename != null && filename.toLowerCase().endsWith(".psd")) { // For PSD files, try explicit ImageReader Iterator readers = ImageIO.getImageReadersByFormatName("PSD"); @@ -134,18 +134,20 @@ public class ImageProcessingUtils { } } 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 + + ". 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); } - + double orientation = extractImageOrientation(file.getInputStream()); return applyOrientation(image, orientation); }