From 40ffe7c426c6818b2dc5c95a65ffb318f19136b9 Mon Sep 17 00:00:00 2001 From: "karthik.bashetty" Date: Wed, 9 Oct 2024 14:21:21 +0530 Subject: [PATCH] Support PDF files with magic byte in the header --- resources/PDF-2.0-with-offset-start.pdf | Bin 0 -> 5264 bytes vips/foreign.go | 14 ++++++++------ vips/foreign_test.go | 11 +++++++++++ vips/image_golden_test.go | 8 ++++++++ vips/image_test.go | 11 +++++++++++ 5 files changed, 38 insertions(+), 6 deletions(-) create mode 100644 resources/PDF-2.0-with-offset-start.pdf diff --git a/resources/PDF-2.0-with-offset-start.pdf b/resources/PDF-2.0-with-offset-start.pdf new file mode 100644 index 0000000000000000000000000000000000000000..4cf62cc204ecbc2c2027451ea265ab8978510c6b GIT binary patch literal 5264 zcmbtY+iv4V5`7n-e<*lhOa?H;yKZX>@Yor|h`ljvVK=+RKD5ZD%nU^;Y|@wfQGO#| zwx_yDigGlQU5o)*Qn9Y5tE;N}9i7wd&v=auFN0G;WYusQsJEiQvCS5TaenyC{5C6x56OTN&oFW0 z!($5w;oBd-|M5E!4F@hcRIGj(4o**p10s9*x|L*Kz))7KHRV>Ufr}5mJN^4cRzjoi z8PZ}g93Wh+WH?}AU*EON*H|_$aArOItqx7PuUD0}`t!~8aKP$RRZ6jePcQSA&2|HW z^s>ovHGesKFJMW|@tw)`d(te`=d<@$xsq76pKorFoJiALY$O3mIeHJ3M5kq(%~Ua=ovtX#b_N*XnnQblFDisL`FPk#>26w6O8Qc1ON_q&>m{&?!js+p^HfvA8t2r;#G7-N2mB zCUx*-U5d>vvQt*LljbNpofpOSwdCYqbl=Ex+=_Sf(edm%_M?17y@=I< zw;b;+rE5y-nvw08jQvxa5$Pe+sMPrP$cKP?5!=JS;RS$m`oMuSzd)W;5~#@q$7VU9 z8zhUYSVtSi|J@JX#WE3fRvj(QQG2XfpotQk?tkB1EqPC)v$sNzTwtXp$T#`#6VGON!Ko(1~6cBomIC$ zZj`;oH2PwgeK&QOheF~|bwN_!6l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