You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2020/08/04 18:17:02 UTC

svn commit: r1880575 - /pdfbox/branches/issue45/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java

Author: tilman
Date: Tue Aug  4 18:17:02 2020
New Revision: 1880575

URL: http://svn.apache.org/viewvc?rev=1880575&view=rev
Log:
PDFBOX-4930: we use the sizes of the ARGB image, these can be different than the original sizes of the base image, when the mask is bigger

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

Modified: pdfbox/branches/issue45/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/issue45/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java?rev=1880575&r1=1880574&r2=1880575&view=diff
==============================================================================
--- pdfbox/branches/issue45/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java (original)
+++ pdfbox/branches/issue45/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java Tue Aug  4 18:17:02 2020
@@ -1043,11 +1043,13 @@ public class PageDrawer extends PDFGraph
 
         if (!pdImage.getInterpolate())
         {
-            boolean isScaledUp = pdImage.getWidth() < Math.round(at.getScaleX()) ||
-                                 pdImage.getHeight() < Math.round(at.getScaleY());
-
             // 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
+            // PDFBOX-4930: we use the sizes of the ARGB image. These can be different
+            // than the original sizes of the base image, when the mask is bigger.
+            boolean isScaledUp = pdImage.getImage().getWidth() < Math.round(at.getScaleX()) ||
+                                 pdImage.getImage().getHeight() < Math.round(at.getScaleY());
+
             if (isScaledUp)
             {
                 graphics.setRenderingHint(RenderingHints.KEY_INTERPOLATION,