mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2025-08-26 14:19:24 +00:00
fixes
This commit is contained in:
parent
5b80a15950
commit
7e265ba0dd
@ -121,7 +121,6 @@ public class ImageProcessingUtils {
|
|||||||
BufferedImage image = null;
|
BufferedImage image = null;
|
||||||
String filename = file.getOriginalFilename();
|
String filename = file.getOriginalFilename();
|
||||||
|
|
||||||
// Try different approaches for different file types
|
|
||||||
if (filename != null && filename.toLowerCase().endsWith(".psd")) {
|
if (filename != null && filename.toLowerCase().endsWith(".psd")) {
|
||||||
// For PSD files, try explicit ImageReader
|
// For PSD files, try explicit ImageReader
|
||||||
Iterator<ImageReader> readers = ImageIO.getImageReadersByFormatName("PSD");
|
Iterator<ImageReader> readers = ImageIO.getImageReadersByFormatName("PSD");
|
||||||
@ -134,16 +133,17 @@ public class ImageProcessingUtils {
|
|||||||
reader.dispose();
|
reader.dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
if (image == null) {
|
||||||
|
throw new IOException("Unable to read image from file: " + filename +
|
||||||
// Fallback to standard ImageIO.read for all files (including PSD if explicit reader failed)
|
". Supported PSD formats: RGB/CMYK/Gray 8-32 bit, RLE/ZIP compression");
|
||||||
if (image == null) {
|
}
|
||||||
|
} else {
|
||||||
|
// For non-PSD files, use standard ImageIO
|
||||||
image = ImageIO.read(file.getInputStream());
|
image = ImageIO.read(file.getInputStream());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (image == null) {
|
if (image == null) {
|
||||||
throw new IOException("Unable to read image from file: " + filename +
|
throw new IOException("Unable to read image from file: " + filename);
|
||||||
". Supported PSD formats: RGB/CMYK/Gray 8-32 bit, RLE/ZIP compression");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
double orientation = extractImageOrientation(file.getInputStream());
|
double orientation = extractImageOrientation(file.getInputStream());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user