summaryrefslogtreecommitdiff
path: root/pdf-over-gui/src/main
diff options
context:
space:
mode:
authorJakob Heher <jakob.heher@iaik.tugraz.at>2022-08-03 13:00:26 +0200
committerJakob Heher <jakob.heher@iaik.tugraz.at>2022-08-03 13:00:26 +0200
commitf9def921178f2c1995b28900e80e2a338257729b (patch)
tree46a9143f7454c6f11451175123c0600bb4d54ca8 /pdf-over-gui/src/main
parenta25b8b2fa18e7789968dbeb802df2dfade577205 (diff)
downloadpdf-over-f9def921178f2c1995b28900e80e2a338257729b.tar.gz
pdf-over-f9def921178f2c1995b28900e80e2a338257729b.tar.bz2
pdf-over-f9def921178f2c1995b28900e80e2a338257729b.zip
refactor out EXIF rotation nonsense into its self-contained class
Diffstat (limited to 'pdf-over-gui/src/main')
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/SimpleConfigurationComposite.java6
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils/SignaturePlaceholderCache.java3
2 files changed, 4 insertions, 5 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/SimpleConfigurationComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/SimpleConfigurationComposite.java
index 4fb4874e..cd8544d8 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/SimpleConfigurationComposite.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/SimpleConfigurationComposite.java
@@ -21,8 +21,6 @@ import java.io.IOException;
import java.util.Arrays;
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;
@@ -54,6 +52,7 @@ import org.eclipse.swt.widgets.Text;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import at.asit.pdfover.Util;
import at.asit.pdfover.commons.Constants;
import at.asit.pdfover.commons.Messages;
import at.asit.pdfover.commons.Profile;
@@ -468,8 +467,7 @@ public class SimpleConfigurationComposite extends ConfigurationCompositeBase {
try {
File imgFile = new File(image);
this.logo = new Image(this.getDisplay(),
- ImageConverter.convertToSWT(Emblem.fixImage(
- ImageIO.read(imgFile), imgFile)));
+ ImageConverter.convertToSWT(Util.readImageWithEXIFRotation(imgFile)));
} catch (IOException e) {
log.error("Error reading image", e);
}
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils/SignaturePlaceholderCache.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils/SignaturePlaceholderCache.java
index 18009895..92efea0a 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils/SignaturePlaceholderCache.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils/SignaturePlaceholderCache.java
@@ -33,6 +33,7 @@ import org.eclipse.swt.graphics.ImageData;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import at.asit.pdfover.Util;
import at.asit.pdfover.commons.Constants;
import at.asit.pdfover.signator.Emblem;
import at.asit.pdfover.signer.pdfas.PdfAs4SignatureParameter;
@@ -52,7 +53,7 @@ public class SignaturePlaceholderCache {
}
private static Image loadImage(String fileDir, String fileName, String fileExt) throws IOException {
- return ImageIO.read(new File(fileDir, fileName + "." + fileExt));
+ return Util.readImageWithEXIFRotation(new File(fileDir, fileName + "." + fileExt));
}
/**