mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 01:10:08 +02:00
parent
30e69956db
commit
9c3471dd01
3 changed files with 40 additions and 21 deletions
|
@ -739,27 +739,36 @@ class PartialEvaluator {
|
||||||
!dict.has("Mask") &&
|
!dict.has("Mask") &&
|
||||||
w + h < SMALL_IMAGE_DIMENSIONS
|
w + h < SMALL_IMAGE_DIMENSIONS
|
||||||
) {
|
) {
|
||||||
const imageObj = new PDFImage({
|
try {
|
||||||
xref: this.xref,
|
const imageObj = new PDFImage({
|
||||||
res: resources,
|
xref: this.xref,
|
||||||
image,
|
res: resources,
|
||||||
isInline,
|
image,
|
||||||
pdfFunctionFactory: this._pdfFunctionFactory,
|
isInline,
|
||||||
localColorSpaceCache,
|
pdfFunctionFactory: this._pdfFunctionFactory,
|
||||||
});
|
localColorSpaceCache,
|
||||||
// We force the use of RGBA_32BPP images here, because we can't handle
|
});
|
||||||
// any other kind.
|
// We force the use of RGBA_32BPP images here, because we can't handle
|
||||||
imgData = await imageObj.createImageData(
|
// any other kind.
|
||||||
/* forceRGBA = */ true,
|
imgData = await imageObj.createImageData(
|
||||||
/* isOffscreenCanvasSupported = */ false
|
/* forceRGBA = */ true,
|
||||||
);
|
/* isOffscreenCanvasSupported = */ false
|
||||||
operatorList.isOffscreenCanvasSupported =
|
);
|
||||||
this.options.isOffscreenCanvasSupported;
|
operatorList.isOffscreenCanvasSupported =
|
||||||
operatorList.addImageOps(
|
this.options.isOffscreenCanvasSupported;
|
||||||
OPS.paintInlineImageXObject,
|
operatorList.addImageOps(
|
||||||
[imgData],
|
OPS.paintInlineImageXObject,
|
||||||
optionalContent
|
[imgData],
|
||||||
);
|
optionalContent
|
||||||
|
);
|
||||||
|
} catch (reason) {
|
||||||
|
const msg = `Unable to decode inline image: "${reason}".`;
|
||||||
|
|
||||||
|
if (!this.options.ignoreErrors) {
|
||||||
|
throw new Error(msg);
|
||||||
|
}
|
||||||
|
warn(msg);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
2
test/pdfs/issue17794.pdf.link
Normal file
2
test/pdfs/issue17794.pdf.link
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
https://github.com/mozilla/pdf.js/files/14607428/image1.pdf
|
||||||
|
|
|
@ -9771,5 +9771,13 @@
|
||||||
"rounds": 1,
|
"rounds": 1,
|
||||||
"annotations": true,
|
"annotations": true,
|
||||||
"type": "eq"
|
"type": "eq"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "issue17794",
|
||||||
|
"file": "pdfs/issue17794.pdf",
|
||||||
|
"md5": "a66b5b938cb44ae241cad845cc3b5d2d",
|
||||||
|
"rounds": 1,
|
||||||
|
"link": true,
|
||||||
|
"type": "eq"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue