Skip to content

[pull] master from mozilla:master - #511

Merged
pull[bot] merged 2 commits into
code:masterfrom
mozilla:master
Aug 21, 2026
Merged

[pull] master from mozilla:master#511
pull[bot] merged 2 commits into
code:masterfrom
mozilla:master

Conversation

@pull

@pull pull Bot commented Aug 21, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

…classes

According to the coverage data this code is now unused, see:
 - https://app.codecov.io/gh/mozilla/pdf.js/commit/9aea8e2dfb142ad7c4e3a2595e8052e5dc8ce160/blob/src/core/jpeg_stream.js?dropdown=coverage#L74
 - https://app.codecov.io/gh/mozilla/pdf.js/commit/9aea8e2dfb142ad7c4e3a2595e8052e5dc8ce160/blob/src/core/jpeg_stream.js?dropdown=coverage#L149
 - https://app.codecov.io/gh/mozilla/pdf.js/commit/9aea8e2dfb142ad7c4e3a2595e8052e5dc8ce160/blob/src/core/jpg.js?dropdown=coverage#L1281

I've not attempted to find out exactly when it was made obsolete, however it most likely happened with the introduction of `ImageDecoder`.

Note that any /Decode entry is already parsed in the `PDFImage` constructor, see [this code](https://github.com/mozilla/pdf.js/blob/9aea8e2dfb142ad7c4e3a2595e8052e5dc8ce160/src/core/image.js#L267-L290), and that the `PDFImage.prototype.getImageBytes` method is only ever invoked with the `forceRGBA`/`forceRGB` parameters set from [this code](https://github.com/mozilla/pdf.js/blob/9aea8e2dfb142ad7c4e3a2595e8052e5dc8ce160/src/core/image.js#L868-L873) respectively [this code](https://github.com/mozilla/pdf.js/blob/9aea8e2dfb142ad7c4e3a2595e8052e5dc8ce160/src/core/image.js#L885-L890).
Note that both of those occurrences are placed within the following block: https://github.com/mozilla/pdf.js/blob/9aea8e2dfb142ad7c4e3a2595e8052e5dc8ce160/src/core/image.js#L834-L839

Hence, outside of the IMAGE_DECODERS build, there's no longer any reason for the `JpegStream` and `JpegImage` classes to implement their own /Decode handling.
Besides removing what's now dead code, it also improves consistency in the code-base given that none of the other image-decoders do this.

Finally, while slightly unrelated, move SMask/Mask checks in the `PDFImage.prototype.createImageData` method to occur earlier instead of unnecessarily repeating them later.
…ansform

Remove the unused /Decode handling from the `JpegStream`/`JpegImage` classes
@pull pull Bot locked and limited conversation to collaborators Aug 21, 2026
@pull pull Bot added the ⤵️ pull label Aug 21, 2026
@pull
pull Bot had a problem deploying to code-coverage August 21, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 21, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 21, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 21, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 21, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 21, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 21, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 21, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 21, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 21, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 21, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 21, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 21, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 21, 2026 14:03 Failure
@pull
pull Bot merged commit 0f26334 into code:master Aug 21, 2026
@pull
pull Bot had a problem deploying to code-coverage August 21, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 21, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 21, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 21, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 21, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 21, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 21, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 21, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 21, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 21, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 21, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 21, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 21, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 21, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 21, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 21, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 21, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 21, 2026 14:03 Failure
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant