pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1763621 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java
Date Thu, 06 Oct 2016 16:06:07 GMT
Author: tilman
Date: Thu Oct  6 16:06:07 2016
New Revision: 1763621

URL: http://svn.apache.org/viewvc?rev=1763621&view=rev
Log:
PDFBOX-3523: disable high quality interpolation if image is scaled up by ctm AND xform (temporary
commit)

Modified:
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java?rev=1763621&r1=1763620&r2=1763621&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java (original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java Thu
Oct  6 16:06:07 2016
@@ -766,8 +766,10 @@ public class PageDrawer extends PDFGraph
 
         if (!pdImage.getInterpolate())
         {
-            boolean isScaledUp = pdImage.getWidth() < Math.round(at.getScaleX()) ||
-                                 pdImage.getHeight() < Math.round(at.getScaleY());
+            Matrix m = new Matrix(xform);
+            m.concatenate(ctm);
+            boolean isScaledUp = pdImage.getWidth() < Math.round(Math.abs(m.getScalingFactorX()))
||
+                                pdImage.getHeight() < Math.round(Math.abs(m.getScalingFactorY()));
 
             // if the image is scaled down, we use smooth interpolation, eg PDFBOX-2364
             // only when scaled up do we use nearest neighbour, eg PDFBOX-2302 / mori-cvpr01.pdf



Mime
View raw message