1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-19 06:38:07 +02:00

Merge pull request #19327 from Snuffleupagus/issue-19326

Access the number of components correctly in JPEG 2000 images with color space entries (issue 19326)
This commit is contained in:
Jonas Jenwald 2025-01-15 11:17:24 +01:00 committed by GitHub
commit 2533a08779
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 11 additions and 1 deletions

View file

@ -219,7 +219,9 @@ class PDFImage {
this.numComps = this.colorSpace.numComps;
if (this.jpxDecoderOptions) {
this.jpxDecoderOptions.numComponents = hasColorSpace ? this.numComp : 0;
this.jpxDecoderOptions.numComponents = hasColorSpace
? this.numComps
: 0;
// If the jpx image has a color space then it musn't be used in order to
// be able to use the color space that comes from the pdf.
this.jpxDecoderOptions.isIndexedColormap =

View file

@ -529,6 +529,7 @@
!bug1743245.pdf
!quadpoints.pdf
!transparent.pdf
!issue19326.pdf
!issue13931.pdf
!xobject-image.pdf
!issue15441.pdf

BIN
test/pdfs/issue19326.pdf Normal file

Binary file not shown.

View file

@ -6364,6 +6364,13 @@
"type": "eq",
"about": "Fixes one part of bug 1731483."
},
{
"id": "issue19326",
"file": "pdfs/issue19326.pdf",
"md5": "b4d937017daf439a6318501428e0c6ba",
"rounds": 1,
"type": "eq"
},
{
"id": "bug1140761",
"file": "pdfs/bug1140761.pdf",