From 62bc32a4f70f74fba351287a60c8d6483124a67a Mon Sep 17 00:00:00 2001 From: BobLd <38405645+BobLd@users.noreply.github.com> Date: Sat, 4 Nov 2023 13:54:05 +0000 Subject: [PATCH] Correctly parse FunctionBasedShading matrix and fix #702 --- .../Integration/Documents/PDFBOX-1869-4-1.pdf | Bin 0 -> 4227 bytes .../Integration/ShadingTests.cs | 10 ++++++++++ src/UglyToad.PdfPig/Util/ShadingParser.cs | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 src/UglyToad.PdfPig.Tests/Integration/Documents/PDFBOX-1869-4-1.pdf diff --git a/src/UglyToad.PdfPig.Tests/Integration/Documents/PDFBOX-1869-4-1.pdf b/src/UglyToad.PdfPig.Tests/Integration/Documents/PDFBOX-1869-4-1.pdf new file mode 100644 index 0000000000000000000000000000000000000000..a43e5d21f823165921b6feede96e8ad2f05b440b GIT binary patch literal 4227 zcmcH-O>7+1IZzI0BoJyXL=F`Xk}yFq``(+s{n74*csF*OX2GnD2r|YR&%Cv#o}F3E zyv1vCD59;(2_gg%1x~;LMQ{QMp{gqFp{No86`>x0aB0=5ZA5?rf})as@6GIwcheXo zGnUtHzxVzBj}Oh)XEd5Kl|yfxfBbpHLIg#tKUKz>UY2q0_;4DUXCU7{b zGdJ>BwW=gMW=>n_J@?DU&R+Wnx$YMizMe|n|M^pYdG8NT)i0b_dHBhd1NU6@*MEQb z#C5;DL4WrA`A_nHy7tkhPe1y|_3lF-teDUI`Sq*p*QQ?RPCYjLuc==ZPJH_EOW*wP z{+AELKfe3o>8r1~=HUK&PyF+%vn$a<-YtLo(U-dQ+1A>tm(@<#LRgAd+x-+O;Q*U&zH{%0SRU#(xsP5#Ay_SM|uXISWE>cUBw zC=3&Ssck74$Q)X~xYc2J-dSU~!93rYj(TW`z_nGhP{Guf72J$C_yQ5Yido2!Ashu@ zmPFmyWeK=&K91Z4#+NWS8R13N<3Lx7f+$|-I4(o9n9>~U@!18*O&2nN%e=$E-yzaz z`h8*D@%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?^Ip44wlkh%vuUTx}}J|mp;h0EW<)A)Q4FHY>VPSVIO7~d03)%!iZUb zEn^I(+Y_{eh~01;&zhvQ32f(Mc(yq~O9_E3awi_O2n1*hW?K_5QZy#)phjU5uV7Eg z)os}3cFG|6;)KqWniKqJ!Gc|AjMmP>`Z@;7lS{yi2^b~$NgvqawP+_lTGU7E<+0-j zEQXhSgvBxhd4S+`HiFkb@rH!(T-b^bC@(NameToken.Coords, scanner, out var matrixToken)) + if (shadingDictionary.TryGet(NameToken.Matrix, scanner, out var matrixToken)) { matrix = TransformationMatrix.FromArray(matrixToken.Data.OfType().Select(n => n.Data).ToArray()); }