Ignore the /Mask entry in images unless its /ImageMask entry is explicitly set to true
(issue 6621)
Fixes 6621.
This commit is contained in:
parent
9455095ee9
commit
50a70429ec
@ -140,7 +140,12 @@ var PDFImage = (function PDFImageClosure() {
|
|||||||
this.smask = new PDFImage(xref, res, smask, false);
|
this.smask = new PDFImage(xref, res, smask, false);
|
||||||
} else if (mask) {
|
} else if (mask) {
|
||||||
if (isStream(mask)) {
|
if (isStream(mask)) {
|
||||||
|
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);
|
this.mask = new PDFImage(xref, res, mask, false, null, null, true);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// Color key mask (just an array).
|
// Color key mask (just an array).
|
||||||
this.mask = mask;
|
this.mask = mask;
|
||||||
|
1
test/pdfs/.gitignore
vendored
1
test/pdfs/.gitignore
vendored
@ -32,6 +32,7 @@
|
|||||||
!issue3879r.pdf
|
!issue3879r.pdf
|
||||||
!close-path-bug.pdf
|
!close-path-bug.pdf
|
||||||
!issue6019.pdf
|
!issue6019.pdf
|
||||||
|
!issue6621.pdf
|
||||||
!issue1293r.pdf
|
!issue1293r.pdf
|
||||||
!issue6541.pdf
|
!issue6541.pdf
|
||||||
!issue2948.pdf
|
!issue2948.pdf
|
||||||
|
BIN
test/pdfs/issue6621.pdf
Normal file
BIN
test/pdfs/issue6621.pdf
Normal file
Binary file not shown.
@ -732,6 +732,13 @@
|
|||||||
"rounds": 1,
|
"rounds": 1,
|
||||||
"type": "load"
|
"type": "load"
|
||||||
},
|
},
|
||||||
|
{ "id": "issue6621",
|
||||||
|
"file": "pdfs/issue6621.pdf",
|
||||||
|
"md5": "8079ce514fb2cdded4251eade6380ba9",
|
||||||
|
"link": false,
|
||||||
|
"rounds": 1,
|
||||||
|
"type": "eq"
|
||||||
|
},
|
||||||
{ "id": "scan-bad",
|
{ "id": "scan-bad",
|
||||||
"file": "pdfs/scan-bad.pdf",
|
"file": "pdfs/scan-bad.pdf",
|
||||||
"md5": "4cf988f01ab83f61aca57f406dfd6584",
|
"md5": "4cf988f01ab83f61aca57f406dfd6584",
|
||||||
|
Loading…
Reference in New Issue
Block a user