mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
[JPX] Throw an exception with the error messages returned by openjpeg
This commit is contained in:
parent
801a0975f2
commit
ebcae3014c
2 changed files with 3 additions and 3 deletions
|
@ -28,8 +28,8 @@ class JpxImage {
|
|||
static decode(data, ignoreColorSpace) {
|
||||
this.#module ||= OpenJPEG();
|
||||
const imageData = this.#module.decode(data, ignoreColorSpace);
|
||||
if (!imageData) {
|
||||
throw new JpxError("JPX decode failed");
|
||||
if (typeof imageData === "string") {
|
||||
throw new JpxError(imageData);
|
||||
}
|
||||
return imageData;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue