Skip to content

Commit

Permalink
Merge pull request #17956 from calixteman/jpx_exceptions
Browse files Browse the repository at this point in the history
[JPX] Throw an exception with the error messages returned by openjpeg
  • Loading branch information
timvandermeij authored Apr 16, 2024
2 parents 921fae5 + ebcae30 commit 7290faf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion external/openjpeg/openjpeg.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/core/jpx.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ class JpxImage {
static decode(data, ignoreColorSpace = false) {
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;
}
Expand Down

0 comments on commit 7290faf

Please sign in to comment.