[pull] master from mozilla:master - #511
Merged
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 : )