summaryrefslogtreecommitdiff
path: root/pdf-over-commons
diff options
context:
space:
mode:
Diffstat (limited to 'pdf-over-commons')
-rw-r--r--pdf-over-commons/src/main/java/at/asit/pdfover/commons/utils/ImageUtil.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/pdf-over-commons/src/main/java/at/asit/pdfover/commons/utils/ImageUtil.java b/pdf-over-commons/src/main/java/at/asit/pdfover/commons/utils/ImageUtil.java
index 4a926226..2b99ea2c 100644
--- a/pdf-over-commons/src/main/java/at/asit/pdfover/commons/utils/ImageUtil.java
+++ b/pdf-over-commons/src/main/java/at/asit/pdfover/commons/utils/ImageUtil.java
@@ -75,14 +75,16 @@ class EXIFRotation {
ExifIFD0Directory metaDir = metadata.getFirstDirectoryOfType(ExifIFD0Directory.class);
if (metaDir == null)
return NONE;
- int orientation = metaDir.getInt(ExifDirectoryBase.TAG_ORIENTATION);
+ Integer orientation = metaDir.getInteger(ExifDirectoryBase.TAG_ORIENTATION);
+ if (orientation == null)
+ return NONE;
if (rotationForIndex.length <= orientation)
{
log.warn("Invalid orientation {} in EXIF metadata for {}", orientation, file.getName());
return NONE;
}
return rotationForIndex[orientation];
- } catch (ImageProcessingException | MetadataException e) {
+ } catch (ImageProcessingException e) {
log.error("Failed to read EXIF metadata for {}", file.getName(), e);
return NONE;
}