Handle lookup errors "silently" in PartialEvaluator.hasBlendModes (PR 11680 follow-up)

Given that this method is used during what's essentially a *pre*-parsing stage, before the actual OperatorList parsing occurs, on second thought it doesn't seem at all necessary to warn and trigger fallback in cases where there's lookup errors.

*Please note:* Any any errors will still be either suppressed or thrown, according to the `ignoreErrors` option, during the *actual* OperatorList parsing.
This commit is contained in:
Jonas Jenwald 2020-07-14 13:00:35 +02:00
parent 6c39aff374
commit 84476da26e

View File

@ -264,20 +264,11 @@ class PartialEvaluator {
if (ex instanceof MissingDataException) { if (ex instanceof MissingDataException) {
throw ex; throw ex;
} }
if (this.options.ignoreErrors) { // Avoid parsing a corrupt ExtGState more than once.
if (graphicState instanceof Ref) { processed[graphicState.toString()] = true;
// Avoid parsing a corrupt ExtGState more than once.
processed[graphicState.toString()] = true; info(`hasBlendModes - ignoring ExtGState: "${ex}".`);
} continue;
// Error(s) in the ExtGState -- sending unsupported feature
// notification and allow parsing/rendering to continue.
this.handler.send("UnsupportedFeature", {
featureId: UNSUPPORTED_FEATURES.errorExtGState,
});
warn(`hasBlendModes - ignoring ExtGState: "${ex}".`);
continue;
}
throw ex;
} }
} }
if (!(graphicState instanceof Dict)) { if (!(graphicState instanceof Dict)) {
@ -326,20 +317,11 @@ class PartialEvaluator {
if (ex instanceof MissingDataException) { if (ex instanceof MissingDataException) {
throw ex; throw ex;
} }
if (this.options.ignoreErrors) { // Avoid parsing a corrupt XObject more than once.
if (xObject instanceof Ref) { processed[xObject.toString()] = true;
// Avoid parsing a corrupt XObject more than once.
processed[xObject.toString()] = true; info(`hasBlendModes - ignoring XObject: "${ex}".`);
} continue;
// Error(s) in the XObject -- sending unsupported feature
// notification and allow parsing/rendering to continue.
this.handler.send("UnsupportedFeature", {
featureId: UNSUPPORTED_FEATURES.errorXObject,
});
warn(`hasBlendModes - ignoring XObject: "${ex}".`);
continue;
}
throw ex;
} }
} }
if (!isStream(xObject)) { if (!isStream(xObject)) {