Gentoo Archives: gentoo-commits

From: "Alexis Ballier (aballier)" <aballier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo commit in src/patchsets/luatex/0.60.0: 040_all_poppler-0.11.3.patch 050_all_upstream-epstopdf_cc_no_xpdf_patching.patch series
Date: Tue, 27 Apr 2010 10:44:11
Message-Id: 20100427104407.35E472C04C@corvid.gentoo.org
1 aballier 10/04/27 10:44:07
2
3 Added: 040_all_poppler-0.11.3.patch
4 050_all_upstream-epstopdf_cc_no_xpdf_patching.patch
5 series
6 Log:
7 add patches for 0.60.0
8
9 Revision Changes Path
10 1.1 src/patchsets/luatex/0.60.0/040_all_poppler-0.11.3.patch
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/luatex/0.60.0/040_all_poppler-0.11.3.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/luatex/0.60.0/040_all_poppler-0.11.3.patch?rev=1.1&content-type=text/plain
14
15 Index: 040_all_poppler-0.11.3.patch
16 ===================================================================
17 Index: luatex-beta-0.60.0/source/texk/web2c/luatexdir/image/pdftoepdf.cc
18 ===================================================================
19 --- luatex-beta-0.60.0.orig/source/texk/web2c/luatexdir/image/pdftoepdf.cc
20 +++ luatex-beta-0.60.0/source/texk/web2c/luatexdir/image/pdftoepdf.cc
21 @@ -471,7 +471,8 @@ read_pdf_info(image_dict * idict, int mi
22 int rotate;
23 char *checksum;
24 PDFRectangle *pagebox;
25 - float pdf_version_found, pdf_version_wanted, xsize, ysize, xorig, yorig;
26 + float xsize, ysize, xorig, yorig;
27 + int minor_pdf_version_found, major_pdf_version_found;
28 assert(idict != NULL);
29 assert(img_type(idict) == IMG_TYPE_PDF);
30 assert(readtype == IMG_CLOSEINBETWEEN); // only this is implemented
31 @@ -494,15 +495,15 @@ read_pdf_info(image_dict * idict, int mi
32 // this works only for PDF 1.x -- but since any versions of PDF newer
33 // than 1.x will not be backwards compatible to PDF 1.x, pdfTeX will
34 // then have to changed drastically anyway.
35 - pdf_version_found = pdf_doc->doc->getPDFVersion();
36 - pdf_version_wanted = 1 + (minor_pdf_version_wanted * 0.1);
37 - if (pdf_version_found > pdf_version_wanted + 0.01) {
38 + minor_pdf_version_found = pdf_doc->doc->getPDFMinorVersion();
39 + major_pdf_version_found = pdf_doc->doc->getPDFMajorVersion();
40 + if (major_pdf_version_found > 1 || minor_pdf_version_found > minor_pdf_version_wanted) {
41 char msg[] =
42 - "PDF inclusion: found PDF version <%.1f>, but at most version <%.1f> allowed";
43 + "PDF inclusion: found PDF version <%d.%d>, but at most version <1.%d> allowed";
44 if (pdf_inclusion_errorlevel > 0) {
45 - pdftex_fail(msg, pdf_version_found, pdf_version_wanted);
46 + pdftex_fail(msg, major_pdf_version_found, minor_pdf_version_found, minor_pdf_version_wanted);
47 } else {
48 - pdftex_warn(msg, pdf_version_found, pdf_version_wanted);
49 + pdftex_warn(msg, major_pdf_version_found, minor_pdf_version_found, minor_pdf_version_wanted);
50 }
51 }
52 img_totalpages(idict) = pdf_doc->doc->getCatalog()->getNumPages();
53
54
55
56 1.1 src/patchsets/luatex/0.60.0/050_all_upstream-epstopdf_cc_no_xpdf_patching.patch
57
58 file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/luatex/0.60.0/050_all_upstream-epstopdf_cc_no_xpdf_patching.patch?rev=1.1&view=markup
59 plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/luatex/0.60.0/050_all_upstream-epstopdf_cc_no_xpdf_patching.patch?rev=1.1&content-type=text/plain
60
61 Index: 050_all_upstream-epstopdf_cc_no_xpdf_patching.patch
62 ===================================================================
63 ---
64 source/texk/web2c/luatexdir/image/pdftoepdf.cc | 86 +++++++++++--------------
65 1 file changed, 39 insertions(+), 47 deletions(-)
66
67 Index: luatex-beta-0.60.0/source/texk/web2c/luatexdir/image/pdftoepdf.cc
68 ===================================================================
69 --- luatex-beta-0.60.0.orig/source/texk/web2c/luatexdir/image/pdftoepdf.cc
70 +++ luatex-beta-0.60.0/source/texk/web2c/luatexdir/image/pdftoepdf.cc
71 @@ -19,8 +19,8 @@
72 with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
73
74 static const char _svn_version[] =
75 - "$Id: 050_all_upstream-epstopdf_cc_no_xpdf_patching.patch,v 1.1 2010/04/27 10:44:07 aballier Exp $ "
76 - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.60.0/source/texk/web2c/luatexdir/image/pdftoepdf.cc $";
77 + "$Id: 050_all_upstream-epstopdf_cc_no_xpdf_patching.patch,v 1.1 2010/04/27 10:44:07 aballier Exp $ "
78 + "$URL: http://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/image/pdftoepdf.cc $";
79
80 #include "epdf.h"
81
82 @@ -592,11 +592,19 @@ static void write_epdf1(PDF pdf, image_d
83 {
84 PdfDocument *pdf_doc;
85 Page *page;
86 - PdfObject info, contents, metadata, obj1;
87 - Object *metadataNF, *resourcesNF;
88 + Ref *pageref;
89 + Dict *pageDict;
90 + PdfObject info, contents, obj1, pageObj, dictObj;
91 + PDFRectangle *pagebox;
92 + int i, l;
93 + float bbox[4];
94 char *checksum;
95 char s[256];
96 - int i, l;
97 + char *pagedictkeys[] =
98 + { "Group", "LastModified", "Metadata", "PieceInfo", "Resources",
99 + "SeparationInfo", NULL
100 + };
101 +
102 assert(idict != NULL);
103 // calculate a checksum string
104 checksum = get_file_checksum(img_filepath(idict));
105 @@ -607,10 +615,12 @@ static void write_epdf1(PDF pdf, image_d
106 img_filename(idict));
107 }
108 free(checksum);
109 - (void) pdf_doc->doc->getCatalog()->getPage(img_pagenum(idict));
110 page = pdf_doc->doc->getCatalog()->getPage(img_pagenum(idict));
111 - PDFRectangle *pagebox;
112 - float bbox[4];
113 + pageref = pdf_doc->doc->getCatalog()->getPageRef(img_pagenum(idict));
114 + assert(pageref != NULL); // was checked already in read_pdf_info()
115 + pdf_doc->doc->getXRef()->fetch(pageref->num, pageref->gen, &pageObj);
116 + pageDict = pageObj->getDict();
117 +
118 // write the Page header
119 pdf_puts(pdf, "/Type /XObject\n/Subtype /Form\n");
120 if (img_attr(idict) != NULL && strlen(img_attr(idict)) > 0)
121 @@ -647,51 +657,33 @@ static void write_epdf1(PDF pdf, image_d
122 pdf_puts(pdf, stripzeros(s));
123 // The /Matrix calculation is replaced by transforms in out_img().
124
125 - // Now all relevant parts of the /Page dictionary are copied:
126 + // Now all relevant parts of the Page dictionary are copied:
127
128 - // write the /Resources dictionary
129 - if (page->getResourceDict() == NULL) {
130 + // Resources validity check
131 + pageDict->lookupNF("Resources", &dictObj);
132 + if (dictObj->isNull()) {
133 // Resources can be missing (files without them have been spotted
134 // in the wild); in which case the /Resouces of the /Page will be used.
135 // "This practice is not recommended".
136 pdftex_warn
137 ("PDF inclusion: /Resources missing. 'This practice is not recommended' (PDF Ref.)");
138 - } else {
139 - resourcesNF = page->getResourcesNF();
140 - pdf_puts(pdf, "/Resources ");
141 - copyObject(pdf, pdf_doc, resourcesNF);
142 - }
143 - // write the page /Metadata if it's there (as a stream it must be indirect)
144 - if (page->getMetadata() != NULL) {
145 - metadataNF = page->getMetadataNF(); // *NF = "don't resolve indirects"
146 - if (!metadataNF->isRef())
147 - pdftex_warn("PDF inclusion: /Metadata must be indirect object");
148 - else {
149 - pdf_printf(pdf, "/Metadata %d 0 R",
150 - addInObj(pdf, pdf_doc, metadataNF->getRef()));
151 - }
152 }
153 - // write the page /Group if it's there
154 - if (page->getGroup() != NULL) {
155 - pdf_puts(pdf, "/Group ");
156 - copyDict(pdf, pdf_doc, page->getGroup());
157 - }
158 - // write the page /PieceInfo if it's there
159 - if (page->getPieceInfo() != NULL) {
160 - pdf_puts(pdf, "/PieceInfo ");
161 - copyDict(pdf, pdf_doc, page->getPieceInfo());
162 - }
163 - // write the page /SeparationInfo if it's there
164 - if (page->getSeparationInfo() != NULL) {
165 - pdf_puts(pdf, "/SeparationInfo ");
166 - copyDict(pdf, pdf_doc, page->getSeparationInfo());
167 - }
168 - // copy LastModified (needed when PieceInfo is there)
169 - if (page->getLastModified() != NULL) {
170 - pdf_printf(pdf, "/LastModified (%s)\n",
171 - page->getLastModified()->getCString());
172 +
173 + // Metadata validity check (as a stream it must be indirect)
174 + pageDict->lookupNF("Metadata", &dictObj);
175 + if (!dictObj->isNull() && !dictObj->isRef())
176 + pdftex_warn("PDF inclusion: /Metadata must be indirect object");
177 +
178 + // copy selected items in Page dictionary
179 + for (i = 0; pagedictkeys[i] != NULL; i++) {
180 + pageDict->lookupNF(pagedictkeys[i], &dictObj);
181 + if (!dictObj->isNull()) {
182 + pdf_printf(pdf, "/%s ", pagedictkeys[i]);
183 + copyObject(pdf, pdf_doc, &dictObj); // preserves indirection
184 + }
185 }
186 - // write the page contents
187 +
188 + // write the Page contents
189 page->getContents(&contents);
190 if (contents->isStream()) {
191 // Variant A: get stream and recompress under control
192 @@ -732,8 +724,8 @@ static void write_epdf1(PDF pdf, image_d
193 for (i = 0, l = contents->arrayGetLength(); i < l; ++i) {
194 PdfObject contentsobj;
195 copyStreamStream(pdf,
196 - (contents->arrayGet(i, &contentsobj))->
197 - getStream());
198 + (contents->
199 + arrayGet(i, &contentsobj))->getStream());
200 if (i < (l - 1)) {
201 // put a space between streams to be on the safe side (streams
202 // should have a trailing space here, but one never knows)
203
204
205
206 1.1 src/patchsets/luatex/0.60.0/series
207
208 file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/luatex/0.60.0/series?rev=1.1&view=markup
209 plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/luatex/0.60.0/series?rev=1.1&content-type=text/plain
210
211 Index: series
212 ===================================================================
213 040_all_poppler-0.11.3.patch
214 050_all_upstream-epstopdf_cc_no_xpdf_patching.patch