Merge pull request #17956 from calixteman/jpx_exceptions
[JPX] Throw an exception with the error messages returned by openjpeg
This commit is contained in:
commit
7290faf840
2
external/openjpeg/openjpeg.js
vendored
2
external/openjpeg/openjpeg.js
vendored
File diff suppressed because one or more lines are too long
@ -28,8 +28,8 @@ class JpxImage {
|
|||||||
static decode(data, ignoreColorSpace = false) {
|
static decode(data, ignoreColorSpace = false) {
|
||||||
this.#module ||= OpenJPEG();
|
this.#module ||= OpenJPEG();
|
||||||
const imageData = this.#module.decode(data, ignoreColorSpace);
|
const imageData = this.#module.decode(data, ignoreColorSpace);
|
||||||
if (!imageData) {
|
if (typeof imageData === "string") {
|
||||||
throw new JpxError("JPX decode failed");
|
throw new JpxError(imageData);
|
||||||
}
|
}
|
||||||
return imageData;
|
return imageData;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user