pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1852216 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/rendering/PDFRenderer.java
Date Sat, 26 Jan 2019 11:11:34 GMT
Author: tilman
Date: Sat Jan 26 11:11:34 2019
New Revision: 1852216

URL: http://svn.apache.org/viewvc?rev=1852216&view=rev
Log:
PDFBOX-4435: disable default interpolation when bitonal

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/rendering/PDFRenderer.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/rendering/PDFRenderer.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/rendering/PDFRenderer.java?rev=1852216&r1=1852215&r2=1852216&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/rendering/PDFRenderer.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/rendering/PDFRenderer.java Sat Jan
26 11:11:34 2019
@@ -468,7 +468,9 @@ public class PDFRenderer
     private RenderingHints createDefaultRenderingHints(Graphics2D graphics)
     {
         RenderingHints r = new RenderingHints(null);
-        r.put(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC);
+        r.put(RenderingHints.KEY_INTERPOLATION, isBitonal(graphics) ?
+                RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR :
+                RenderingHints.VALUE_INTERPOLATION_BICUBIC);
         r.put(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
         r.put(RenderingHints.KEY_ANTIALIASING, isBitonal(graphics) ?
                                         RenderingHints.VALUE_ANTIALIAS_OFF :



Mime
View raw message