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 #wasmUrl = null;
|
||||||
|
|
||||||
static setOptions({ handler, useWasm, useWorkerFetch, wasmUrl }) {
|
static setOptions({ handler, useWasm, useWorkerFetch, wasmUrl }) {
|
||||||
if (this.#buffer || this.#modulePromise) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.#useWasm = useWasm;
|
this.#useWasm = useWasm;
|
||||||
this.#useWorkerFetch = useWorkerFetch;
|
this.#useWorkerFetch = useWorkerFetch;
|
||||||
this.#wasmUrl = wasmUrl;
|
this.#wasmUrl = wasmUrl;
|
||||||
|
|||||||
@ -70,7 +70,7 @@ class BasePdfManager {
|
|||||||
FeatureTest.isImageDecoderSupported;
|
FeatureTest.isImageDecoderSupported;
|
||||||
this.evaluatorOptions = Object.freeze(evaluatorOptions);
|
this.evaluatorOptions = Object.freeze(evaluatorOptions);
|
||||||
|
|
||||||
// Initially image-options once per document.
|
// Initialize image-options once per document.
|
||||||
ImageResizer.setOptions(evaluatorOptions);
|
ImageResizer.setOptions(evaluatorOptions);
|
||||||
JpegStream.setOptions(evaluatorOptions);
|
JpegStream.setOptions(evaluatorOptions);
|
||||||
JpxImage.setOptions({ ...evaluatorOptions, handler });
|
JpxImage.setOptions({ ...evaluatorOptions, handler });
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user