1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

Fix JpxImage API issues (PR 17946 follow-up)

This commit changes the `JpxImage.decode` method signature to define the
`ignoreColorSpace` argument as optional with a default value. Note that
we already set this default value in the `getBytes` method of the
`src/core/decode_stream.js` file since this option only seems useful for
certain special cases and therefore shouldn't be mandatory to provide.

Moreover, the JPX fuzzer is changed to use the new `JpxImage` API.
This commit is contained in:
Tim van der Meij 2024-04-16 16:24:24 +02:00
parent 801a0975f2
commit c08b09d3b9
No known key found for this signature in database
GPG key ID: 8C3FD2925A5F2762
2 changed files with 2 additions and 2 deletions

View file

@ -25,7 +25,7 @@ class JpxError extends BaseException {
class JpxImage {
static #module = null;
static decode(data, ignoreColorSpace) {
static decode(data, ignoreColorSpace = false) {
this.#module ||= OpenJPEG();
const imageData = this.#module.decode(data, ignoreColorSpace);
if (!imageData) {