aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/utils/ImageUtils.java
diff options
context:
space:
mode:
Diffstat (limited to 'pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/utils/ImageUtils.java')
-rw-r--r--pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/utils/ImageUtils.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/utils/ImageUtils.java b/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/utils/ImageUtils.java
index 39ebd3e0..96efa315 100644
--- a/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/utils/ImageUtils.java
+++ b/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/utils/ImageUtils.java
@@ -179,7 +179,16 @@ public class ImageUtils {
}
is = new FileInputStream(img_file);
- } catch (PdfAsException | IOException e) {
+ } catch (PdfAsException e) {
+ try {
+ is = new ByteArrayInputStream(Base64.decodeBase64(imageValue));
+ } catch (Throwable e1) {
+ // Ignore value is not base 64!
+ logger.debug("Value is not base64: ", e1);
+ // rethrow e
+ throw e;
+ }
+ } catch (IOException e) {
try {
is = new ByteArrayInputStream(Base64.decodeBase64(imageValue));
} catch (Throwable e1) {