[Pkg-javascript-commits] [pdf.js] 72/106: Fetch parameters if they are |Ref|s in Pattern color spaces (issue 6081)

David Prévot taffit at moszumanska.debian.org
Sat Jun 20 21:34:56 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 64e1fb99fec75ca675905483c184d7df420ee0bf
Author: Jonas Jenwald <jonas.jenwald at gmail.com>
Date:   Thu Jun 4 21:28:14 2015 +0200

    Fetch parameters if they are |Ref|s in Pattern color spaces (issue 6081)
    
    Fixes 6081.
---
 src/core/colorspace.js  |   4 ++--
 test/pdfs/.gitignore    |   1 +
 test/pdfs/issue6081.pdf | Bin 0 -> 2266 bytes
 test/test_manifest.json |   7 +++++++
 4 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/core/colorspace.js b/src/core/colorspace.js
index b6db086..bebe952 100644
--- a/src/core/colorspace.js
+++ b/src/core/colorspace.js
@@ -260,7 +260,7 @@ var ColorSpace = (function ColorSpaceClosure() {
           error('unrecognized colorspace ' + mode);
       }
     } else if (isArray(cs)) {
-      mode = cs[0].name;
+      mode = xref.fetchIfRef(cs[0]).name;
       this.mode = mode;
       var numComps, params;
 
@@ -293,7 +293,7 @@ var ColorSpace = (function ColorSpaceClosure() {
           }
           break;
         case 'Pattern':
-          var basePatternCS = cs[1];
+          var basePatternCS = xref.fetchIfRef(cs[1]) || null;
           if (basePatternCS) {
             basePatternCS = ColorSpace.parseToIR(basePatternCS, xref, res);
           }
diff --git a/test/pdfs/.gitignore b/test/pdfs/.gitignore
index 0055360..f33c1a8 100644
--- a/test/pdfs/.gitignore
+++ b/test/pdfs/.gitignore
@@ -134,3 +134,4 @@
 !issue5909.pdf
 !issue6010_1.pdf
 !issue6010_2.pdf
+!issue6081.pdf
diff --git a/test/pdfs/issue6081.pdf b/test/pdfs/issue6081.pdf
new file mode 100644
index 0000000..096d85d
Binary files /dev/null and b/test/pdfs/issue6081.pdf differ
diff --git a/test/test_manifest.json b/test/test_manifest.json
index 55e9242..a004897 100644
--- a/test/test_manifest.json
+++ b/test/test_manifest.json
@@ -1531,6 +1531,13 @@
       "type": "eq",
       "about": "Pattern with current transform different than base transform."
     },
+    {  "id": "issue6081",
+       "file": "pdfs/issue6081.pdf",
+       "md5": "854326ce9178d10ff4a0ff2aedf67e45",
+       "rounds": 1,
+       "link": false,
+       "type": "eq"
+    },
     {  "id": "issue2462",
       "file": "pdfs/issue2462.pdf",
       "md5": "d4e3dddfdd35464c71cf0310bff29b42",

-- 
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