Author: tilman Date: Tue Mar 25 05:57:12 2014 New Revision: 1581244 URL: http://svn.apache.org/r1581244 Log: PDFBOX-1998: different composite for rendering of /ImageMask true /Decode [ 1 0 ]
Modified: pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/xobject/PDXObjectImage.java Modified: pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/xobject/PDXObjectImage.java URL: http://svn.apache.org/viewvc/pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/xobject/PDXObjectImage.java?rev=1581244&r1=1581243&r2=1581244&view=diff ============================================================================== --- pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/xobject/PDXObjectImage.java (original) +++ pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/xobject/PDXObjectImage.java Tue Mar 25 05:57:12 2014 @@ -187,9 +187,16 @@ public abstract class PDXObjectImage ext } graphics.fillRect(0, 0, baseImage.getWidth(), baseImage.getHeight()); - // assume default values ([0,1]) for the DecodeArray - // TODO DecodeArray == [1,0] - graphics.setComposite(AlphaComposite.DstIn); + COSArray decode = getDecode(); + if (decode != null && decode.getInt(0) == 1) + { + // PDFBOX-1998 + graphics.setComposite(AlphaComposite.DstOut); + } + else + { + graphics.setComposite(AlphaComposite.DstIn); + } graphics.drawImage(baseImage, null, 0, 0); graphics.dispose(); return stencilMask;