summaryrefslogtreecommitdiff
path: root/pdf-over-gui/src/main/java/at
diff options
context:
space:
mode:
authorTobias Kellner <tobias.kellner@iaik.tugraz.at>2016-11-15 16:06:18 +0100
committerTobias Kellner <tobias.kellner@iaik.tugraz.at>2016-11-15 16:06:18 +0100
commit2390462418facd6c323143c06cc30c1ba6051c97 (patch)
tree5c81a608d5cc5adb627a7f696d02078f30ed9ac8 /pdf-over-gui/src/main/java/at
parent7cd102ad6924c97974b79e36a946b5dcd6c7e407 (diff)
downloadmocca-2390462418facd6c323143c06cc30c1ba6051c97.tar.gz
mocca-2390462418facd6c323143c06cc30c1ba6051c97.tar.bz2
mocca-2390462418facd6c323143c06cc30c1ba6051c97.zip
Honor EXIF orientation metadata for JPEG logos
Diffstat (limited to 'pdf-over-gui/src/main/java/at')
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java
index 4c02c044..e54b4a59 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java
@@ -17,8 +17,11 @@ package at.asit.pdfover.gui.composites;
// Imports
import java.io.File;
+import java.io.IOException;
import java.util.Locale;
+import javax.imageio.ImageIO;
+
import org.eclipse.swt.SWT;
import org.eclipse.swt.dnd.DND;
import org.eclipse.swt.dnd.DropTarget;
@@ -64,6 +67,7 @@ import at.asit.pdfover.gui.controls.ErrorDialog;
import at.asit.pdfover.gui.controls.ErrorMarker;
import at.asit.pdfover.gui.exceptions.InvalidEmblemFile;
import at.asit.pdfover.gui.exceptions.InvalidNumberException;
+import at.asit.pdfover.gui.utils.ImageConverter;
import at.asit.pdfover.gui.utils.Messages;
import at.asit.pdfover.gui.utils.SignaturePlaceholderCache;
import at.asit.pdfover.gui.workflow.config.ConfigManipulator;
@@ -635,7 +639,14 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite {
}
if (logo != null) {
- this.logo = new Image(this.getDisplay(), logo);
+ try {
+ File imgFile = new File(image);
+ this.logo = new Image(this.getDisplay(),
+ ImageConverter.convertToSWT(CachedFileNameEmblem.fixImage(
+ ImageIO.read(imgFile), imgFile)));
+ } catch (IOException e) {
+ log.error("Error reading image", e); //$NON-NLS-1$
+ }
} else {
this.logo = null;
}