📁 pre-commit

Signed-off-by: stirlingbot[bot] <stirlingbot[bot]@users.noreply.github.com>
This commit is contained in:
stirlingbot[bot] 2025-08-08 14:43:04 +00:00 committed by GitHub
parent 71ac4283b2
commit 1bed5798ec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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<ImageReader> 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);
}