Simplify JpxImage.setOptions a little bit
After PR 19392 we're only invoking this method *once* per document, hence the early-return branch shouldn't be necessary any more.
This commit is contained in:
parent
641e2f506e
commit
637e95985a
@ -38,9 +38,6 @@ class JpxImage {
|
||||
static #wasmUrl = null;
|
||||
|
||||
static setOptions({ handler, useWasm, useWorkerFetch, wasmUrl }) {
|
||||
if (this.#buffer || this.#modulePromise) {
|
||||
return;
|
||||
}
|
||||
this.#useWasm = useWasm;
|
||||
this.#useWorkerFetch = useWorkerFetch;
|
||||
this.#wasmUrl = wasmUrl;
|
||||
|
||||
@ -70,7 +70,7 @@ class BasePdfManager {
|
||||
FeatureTest.isImageDecoderSupported;
|
||||
this.evaluatorOptions = Object.freeze(evaluatorOptions);
|
||||
|
||||
// Initially image-options once per document.
|
||||
// Initialize image-options once per document.
|
||||
ImageResizer.setOptions(evaluatorOptions);
|
||||
JpegStream.setOptions(evaluatorOptions);
|
||||
JpxImage.setOptions({ ...evaluatorOptions, handler });
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user