mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
When stopAtErrors
is set, throw rather than warn when exceeding maxImageSize
(issue 14626)
The situation described in issue 14626 seems like a fairly special case, and it thus seem reasonable that we simply follow the same pattern as elsewhere in the `PartialEvaluator` when the `stopAtErrors` API-option is being used.
This commit is contained in:
parent
234aa9a50e
commit
d0d5c596fb
1 changed files with 7 additions and 2 deletions
|
@ -576,8 +576,13 @@ class PartialEvaluator {
|
|||
}
|
||||
const maxImageSize = this.options.maxImageSize;
|
||||
if (maxImageSize !== -1 && w * h > maxImageSize) {
|
||||
warn("Image exceeded maximum allowed size and was removed.");
|
||||
return;
|
||||
const msg = "Image exceeded maximum allowed size and was removed.";
|
||||
|
||||
if (this.options.ignoreErrors) {
|
||||
warn(msg);
|
||||
return;
|
||||
}
|
||||
throw new Error(msg);
|
||||
}
|
||||
|
||||
let optionalContent;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue