[Pkg-javascript-commits] [pdf.js] 28/109: Only take the fast-path in `PDFImage_createImageData` for un-masked JPEG images with "standard" colour spaces (issue 6364)

David Prévot taffit at moszumanska.debian.org
Fri Sep 25 03:04:14 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository pdf.js.

commit 3fa5f6cc3b30bb4808ea6c7fa86d702501e9af53
Author: Jonas Jenwald <jonas.jenwald at gmail.com>
Date:   Tue Aug 18 22:25:37 2015 +0200

    Only take the fast-path in `PDFImage_createImageData` for un-masked JPEG images with "standard" colour spaces (issue 6364)
    
    Fixes 6364.
---
 src/core/image.js            | 5 ++++-
 test/pdfs/issue6364.pdf.link | 1 +
 test/test_manifest.json      | 9 +++++++++
 3 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/src/core/image.js b/src/core/image.js
index ec01437..5f3aa6c 100644
--- a/src/core/image.js
+++ b/src/core/image.js
@@ -562,7 +562,10 @@ var PDFImage = (function PDFImageClosure() {
           }
           return imgData;
         }
-        if (this.image instanceof JpegStream && !this.smask && !this.mask) {
+        if (this.image instanceof JpegStream && !this.smask && !this.mask &&
+            (this.colorSpace.name === 'DeviceGray' ||
+             this.colorSpace.name === 'DeviceRGB' ||
+             this.colorSpace.name === 'DeviceCMYK')) {
           imgData.kind = ImageKind.RGB_24BPP;
           imgData.data = this.getImageBytes(originalHeight * rowBytes,
                                             drawWidth, drawHeight, true);
diff --git a/test/pdfs/issue6364.pdf.link b/test/pdfs/issue6364.pdf.link
new file mode 100644
index 0000000..c0eaa8d
--- /dev/null
+++ b/test/pdfs/issue6364.pdf.link
@@ -0,0 +1 @@
+http://web.archive.org/web/20150818180340/http://www.rightprospectus.com/documents/Osterweis/SEMI_Osterweis.pdf
diff --git a/test/test_manifest.json b/test/test_manifest.json
index 0655467..65512c7 100644
--- a/test/test_manifest.json
+++ b/test/test_manifest.json
@@ -1487,6 +1487,15 @@
       "link": true,
       "type": "eq"
     },
+    {  "id": "issue6364",
+       "file": "pdfs/issue6364.pdf",
+       "md5": "b290328531ecdddf6b4c794b4b2fec28",
+       "rounds": 1,
+       "link": true,
+       "firstPage": 1,
+       "lastPage": 1,
+       "type": "eq"
+    },
     { "id": "bug898853.pdf",
       "file": "pdfs/bug898853.pdf",
       "md5": "37c37702bf98d33f9f74e2380c4d1a3f",

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git



More information about the Pkg-javascript-commits mailing list