mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2025-08-11 13:48:37 +02:00
🤖 format everything with pre-commit by stirlingbot (#4150)
Auto-generated by [create-pull-request][1] with **stirlingbot** [1]: https://github.com/peter-evans/create-pull-request Signed-off-by: stirlingbot[bot] <stirlingbot[bot]@users.noreply.github.com> Co-authored-by: stirlingbot[bot] <195170888+stirlingbot[bot]@users.noreply.github.com>
This commit is contained in:
parent
71ac4283b2
commit
678a9bc463
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user