1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 01:58:06 +02:00

Implement Decode entry in Indexed images

This commit is contained in:
Jani Pehkonen 2019-01-22 19:59:36 +02:00
parent f26129de26
commit 26121177ab
7 changed files with 37 additions and 14 deletions

View file

@ -100,6 +100,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
}
var cs = ColorSpace.parse(dict.get('ColorSpace', 'CS'), xref, res,
pdfFunctionFactory);
// isDefaultDecode() of DeviceGray and DeviceRGB needs no `bpc` argument.
return (cs.name === 'DeviceGray' || cs.name === 'DeviceRGB') &&
cs.isDefaultDecode(dict.getArray('Decode', 'D'));
};
@ -114,8 +115,9 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
}
var cs = ColorSpace.parse(dict.get('ColorSpace', 'CS'), xref, res,
pdfFunctionFactory);
const bpc = dict.get('BitsPerComponent', 'BPC') || 1;
return (cs.numComps === 1 || cs.numComps === 3) &&
cs.isDefaultDecode(dict.getArray('Decode', 'D'));
cs.isDefaultDecode(dict.getArray('Decode', 'D'), bpc);
};
function PartialEvaluator({ pdfManager, xref, handler, pageIndex, idFactory,