From 64e1fb99fec75ca675905483c184d7df420ee0bf Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Thu, 4 Jun 2015 21:28:14 +0200 Subject: [PATCH] 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(-) create mode 100644 test/pdfs/issue6081.pdf diff --git a/src/core/colorspace.js b/src/core/colorspace.js index b6db08698..bebe9521a 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 00553605e..f33c1a83c 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 0000000000000000000000000000000000000000..096d85dde3ad1703c8b834f5180c9d3c890b8cbe GIT binary patch literal 2266 zcmcImO>7%Q6b>OYu&oh7ifF>$fa=yM&U$~mKMo-xi4zhvPF>qkfw+>_>#?)#ddFIi zN!&`D5K`JBLJ$G!p&+4%0~{&6fRsc~D2NudDhDJ|gd(^>50Mb!&H68YDnb?OAI-e? z=FOY$eQ)0SESvJKk3XRzY#Zhd+dXP?H zr$A>>7!p&1$;CzyX!fp|$z*UQb8)4uOQXvSgUJHcf&{aGOAbg9yN+aA3#N#08``6zrU^(xKR)WdsG_@omU)2ux?Z zScY6$izF=avLwhzR(K$yg5bwTA`zr$DlbZkXB;ab&oKNf@ew-8XkkrOxi6xM4ZeW0zNPH6)tztsur-VkR+#qle%+L?-|| z@Q|`>pj>lFjj44=LH%Nq;t~qO=%vPJ3x96P@zSrqNZ-lQbfEKlZV&eA2Q&`0e3qJ-6%Rm3|y-!WVKIuFEsC~2Jfn&el zzMelmf8e+EZ~pw_O5l;(d)E$kioqYx-B`Zo$^I^PDzf_7L#wBsc<;dK#M6J>YCrda z)&J&Cdp-|-p)aaGeE7yt*M+~=U!A_(`O%rHOB?N9tvn8Sf#h$m6;|x6_!}_8H2}~a zv2u)&teg^F;zvk@F>PzPv+J|vVW>i9iHibBY&dA#sN!-E#rP=S3;sr+OsPejD66JG zv|kcL_==HQBYC-L!q%r;!#suELuJHzWQq{G%=AZab&j|YR={uz!TF*cEamdSDdH9l zJ2*OT6iYS^Ms$t246_BvO7QWmu#kf9uQP|V6&C>yS-hyBMqwU4GB1PcSxQU&q0rpi z91k(~QFbKWBt>t#&1G9}6G(3MQ#cG#6-8DMG~XIptk<`CU0tTh@B+ae){A%Pf8a6n O|1~yIgSUcuYx@Uf)KNPC literal 0 HcmV?d00001 diff --git a/test/test_manifest.json b/test/test_manifest.json index 55e924245..a004897e0 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",