mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-08-02 12:27:21 +02:00
Merge pull request #20982 from calixteman/debugger_images_preview
Display mask in the tree view in the debugger
This commit is contained in:
commit
d3fd72e7e8
@ -2082,10 +2082,13 @@ class PDFDocument {
|
|||||||
const obj = Object.create(null);
|
const obj = Object.create(null);
|
||||||
obj.dict = await this.toJSObject(dict, false);
|
obj.dict = await this.toJSObject(dict, false);
|
||||||
|
|
||||||
if (
|
if (isName(dict.get("Subtype"), "Image")) {
|
||||||
isName(dict.get("Type"), "XObject") &&
|
const isImageMask = dict.get("ImageMask") === true;
|
||||||
isName(dict.get("Subtype"), "Image")
|
if (isImageMask) {
|
||||||
) {
|
dict.set("ImageMask", false);
|
||||||
|
dict.set("IM", false);
|
||||||
|
value.numComps = value.bitsPerComponent = 1;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
const pdfFunctionFactory = new PDFFunctionFactory({
|
const pdfFunctionFactory = new PDFFunctionFactory({
|
||||||
xref: this.xref,
|
xref: this.xref,
|
||||||
@ -2113,6 +2116,11 @@ class PDFDocument {
|
|||||||
} catch {
|
} catch {
|
||||||
// Fall through to regular byte stream if image decoding fails.
|
// Fall through to regular byte stream if image decoding fails.
|
||||||
}
|
}
|
||||||
|
if (isImageMask) {
|
||||||
|
dict.set("ImageMask", true);
|
||||||
|
delete value.numComps;
|
||||||
|
delete value.bitsPerComponent;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isName(dict.get("Subtype"), "Form")) {
|
if (isName(dict.get("Subtype"), "Form")) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user