Merge pull request #6628 from Snuffleupagus/issue-6621

Ignore the /Mask entry in images unless its /ImageMask entry is explicitly set to `true` (issue 6621)
This commit is contained in:
Yury Delendik 2015-11-12 16:54:00 -06:00
commit 9e335a61fd
4 changed files with 14 additions and 1 deletions

View File

@ -140,7 +140,12 @@ var PDFImage = (function PDFImageClosure() {
this.smask = new PDFImage(xref, res, smask, false);
} else if (mask) {
if (isStream(mask)) {
this.mask = new PDFImage(xref, res, mask, false, null, null, true);
var maskDict = mask.dict, imageMask = maskDict.get('ImageMask', 'IM');
if (!imageMask) {
warn('Ignoring /Mask in image without /ImageMask.');
} else {
this.mask = new PDFImage(xref, res, mask, false, null, null, true);
}
} else {
// Color key mask (just an array).
this.mask = mask;

View File

@ -32,6 +32,7 @@
!issue3879r.pdf
!close-path-bug.pdf
!issue6019.pdf
!issue6621.pdf
!issue1293r.pdf
!issue6541.pdf
!issue2948.pdf

BIN
test/pdfs/issue6621.pdf Normal file

Binary file not shown.

View File

@ -732,6 +732,13 @@
"rounds": 1,
"type": "load"
},
{ "id": "issue6621",
"file": "pdfs/issue6621.pdf",
"md5": "8079ce514fb2cdded4251eade6380ba9",
"link": false,
"rounds": 1,
"type": "eq"
},
{ "id": "scan-bad",
"file": "pdfs/scan-bad.pdf",
"md5": "4cf988f01ab83f61aca57f406dfd6584",