1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-19 22:58:07 +02:00

Merge pull request #17985 from calixteman/openjpeg_warn

Use the pdf.js warn when using jpx decoder
This commit is contained in:
calixteman 2024-04-22 16:06:13 +02:00 committed by GitHub
commit f6b0413506
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

File diff suppressed because one or more lines are too long

View file

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { BaseException } from "../shared/util.js";
import { BaseException, warn } from "../shared/util.js";
import OpenJPEG from "../../external/openjpeg/openjpeg.js";
class JpxError extends BaseException {
@ -26,7 +26,7 @@ class JpxImage {
static #module = null;
static decode(data, ignoreColorSpace = false) {
this.#module ||= OpenJPEG();
this.#module ||= OpenJPEG({ warn });
const imageData = this.#module.decode(data, ignoreColorSpace);
if (typeof imageData === "string") {
throw new JpxError(imageData);