From 0c14d6e2db7ec1ecaa2b66a0bbf72a3adc470b3f Mon Sep 17 00:00:00 2001 From: Calixte Denizet Date: Fri, 17 Jan 2025 20:43:59 +0100 Subject: [PATCH] Handle the case where openjpeg.wasm is missing It fixes #19336. --- src/core/jpx.js | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/core/jpx.js b/src/core/jpx.js index 003fc7bf9..38215d86b 100644 --- a/src/core/jpx.js +++ b/src/core/jpx.js @@ -29,8 +29,6 @@ class JpxImage { static #handler = null; - static #instantiationFailed = false; - static #modulePromise = null; static #wasmUrl = null; @@ -58,10 +56,6 @@ class JpxImage { } const results = await WebAssembly.instantiate(this.#buffer, imports); return successCallback(results.instance); - } catch (e) { - this.#instantiationFailed = true; - warn(`Cannot load ${filename}: "${e}".`); - return false; } finally { this.#handler = null; this.#wasmUrl = null; @@ -72,10 +66,6 @@ class JpxImage { bytes, { numComponents = 4, isIndexedColormap = false, smaskInData = false } = {} ) { - if (this.#instantiationFailed) { - throw new JpxError("OpenJPEG failed to instantiate."); - } - this.#modulePromise ||= OpenJPEG({ warn, instantiateWasm: this.#instantiateWasm.bind(this),