From 01a8dcbaa157f47a9a91bf6b4d99c57c86373595 Mon Sep 17 00:00:00 2001 From: Markus Sunela Date: Thu, 12 Apr 2018 08:54:48 +0300 Subject: [PATCH 1/2] Enable OSGi for the module. --- pom.xml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e8af8dc..f425fd0 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.orsonpdf orsonpdf 1.8 - jar + bundle OrsonPDF http://www.object-refinery.com/orsonpdf @@ -64,6 +64,14 @@ ${project.build.sourceEncoding} + + org.apache.felix + maven-bundle-plugin + 3.3.0 + true + + + From 9508be15e464629b76b7b32b07bf97f0fe66a784 Mon Sep 17 00:00:00 2001 From: Markus Sunela Date: Thu, 12 Apr 2018 08:55:44 +0300 Subject: [PATCH 2/2] Allow calling drawImage with null op, like JDK does. --- src/main/java/com/orsonpdf/PDFGraphics2D.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/orsonpdf/PDFGraphics2D.java b/src/main/java/com/orsonpdf/PDFGraphics2D.java index 797dad3..ebd1793 100644 --- a/src/main/java/com/orsonpdf/PDFGraphics2D.java +++ b/src/main/java/com/orsonpdf/PDFGraphics2D.java @@ -1234,8 +1234,13 @@ public boolean drawImage(Image img, AffineTransform xform, */ @Override public void drawImage(BufferedImage img, BufferedImageOp op, int x, int y) { - BufferedImage imageToDraw = op.filter(img, null); - drawImage(imageToDraw, new AffineTransform(1f, 0f, 0f, 1f, x, y), null); + BufferedImage imageToDraw; + if (op != null) + imageToDraw = op.filter(img, null); + else + imageToDraw = img; + + drawImage(imageToDraw, new AffineTransform(1f, 0f, 0f, 1f, x, y), null); } /**