diff options
Diffstat (limited to 'pdf-over-signator')
-rw-r--r-- | pdf-over-signator/src/main/java/at/asit/pdfover/signator/CachedFileNameEmblem.java | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/pdf-over-signator/src/main/java/at/asit/pdfover/signator/CachedFileNameEmblem.java b/pdf-over-signator/src/main/java/at/asit/pdfover/signator/CachedFileNameEmblem.java index 2b70afa3..51d094eb 100644 --- a/pdf-over-signator/src/main/java/at/asit/pdfover/signator/CachedFileNameEmblem.java +++ b/pdf-over-signator/src/main/java/at/asit/pdfover/signator/CachedFileNameEmblem.java @@ -101,10 +101,9 @@ public class CachedFileNameEmblem implements Emblem { if (reader.getFormatName().equals("JPEG")) { try { Metadata metadata = ImageMetadataReader.readMetadata(imgFile); - - if(metadata != null) { - int orientation = metadata.getFirstDirectoryOfType( - ExifIFD0Directory.class).getInt( + ExifIFD0Directory metaDirectory = (metadata != null) ? metadata.getFirstDirectoryOfType(ExifIFD0Directory.class) : null; + if (metaDirectory != null) { + int orientation = metaDirectory.getInt( ExifDirectoryBase.TAG_ORIENTATION); if (orientation > 2) { // rotate |