From 2d7a34d692a8a26348e27c7dd584729711029f2d Mon Sep 17 00:00:00 2001 From: Yury Delendik Date: Wed, 15 Oct 2014 15:56:29 -0500 Subject: [PATCH] Fixes decoding for CMYK jpegs. --- src/core/stream.js | 2 +- test/pdfs/bug1072164.pdf.link | 1 + test/test_manifest.json | 8 ++++++++ 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 test/pdfs/bug1072164.pdf.link diff --git a/src/core/stream.js b/src/core/stream.js index bd244735c..a84295697 100644 --- a/src/core/stream.js +++ b/src/core/stream.js @@ -884,7 +884,7 @@ var JpegStream = (function JpegStreamClosure() { var jpegImage = new JpegImage(); // checking if values needs to be transformed before conversion - if (this.dict && isArray(this.dict.get('Decode'))) { + if (this.forceRGB && this.dict && isArray(this.dict.get('Decode'))) { var decodeArr = this.dict.get('Decode'); var bitsPerComponent = this.dict.get('BitsPerComponent') || 8; var decodeArrLength = decodeArr.length; diff --git a/test/pdfs/bug1072164.pdf.link b/test/pdfs/bug1072164.pdf.link new file mode 100644 index 000000000..c3868f641 --- /dev/null +++ b/test/pdfs/bug1072164.pdf.link @@ -0,0 +1 @@ +https://bugzilla.mozilla.org/attachment.cgi?id=8494369 diff --git a/test/test_manifest.json b/test/test_manifest.json index 45de838d2..4d2165928 100644 --- a/test/test_manifest.json +++ b/test/test_manifest.json @@ -1602,6 +1602,14 @@ "rounds": 1, "type": "eq" }, + { "id": "bug1072164", + "file": "pdfs/bug1072164.pdf", + "md5": "cfee3c51e8464aa44218f4eaf27e084b", + "rounds": 1, + "link": true, + "type": "eq", + "about": "CMYK jpeg with mask" + }, { "id": "bug886717", "file": "pdfs/bug886717.pdf", "md5": "8ba614192797a1324765610231a1bc9d",