From 2390462418facd6c323143c06cc30c1ba6051c97 Mon Sep 17 00:00:00 2001 From: Tobias Kellner Date: Tue, 15 Nov 2016 16:06:18 +0100 Subject: Honor EXIF orientation metadata for JPEG logos --- .../gui/composites/SimpleConfigurationComposite.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'pdf-over-gui/src/main') 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; } -- cgit v1.2.3