Skip to content

Commit 02d02d1

Browse files
committed
PDFBOX-4627, PDFBOX-5054: ignore non-stencil images in type3 charprocs with d1 or uncolored tiling patterns
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1922858 13f79535-47bb-0310-9956-ffa450edef68
1 parent 8f806dd commit 02d02d1

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/graphics/BeginInlineImage.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ public void process(Operator operator, List<COSBase> operands) throws IOExceptio
5454
{
5555
return;
5656
}
57+
if (!image.isStencil() && !context.isShouldProcessColorOperators())
58+
{
59+
return;
60+
}
5761
context.drawImage(image);
5862
}
5963

pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/graphics/DrawObject.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,11 @@ public void process(Operator operator, List<COSBase> operands) throws IOExceptio
7070
}
7171
else if (xobject instanceof PDImageXObject)
7272
{
73-
PDImageXObject image = (PDImageXObject)xobject;
73+
PDImageXObject image = (PDImageXObject) xobject;
74+
if (!image.isStencil() && !context.isShouldProcessColorOperators())
75+
{
76+
return;
77+
}
7478
context.drawImage(image);
7579
}
7680
else if (xobject instanceof PDFormXObject)

0 commit comments

Comments
 (0)