import cups-filters-1.20.0-24.el8
This commit is contained in:
parent
0ab673c10a
commit
1339d8828d
|
@ -0,0 +1,27 @@
|
||||||
|
From e7103a7aaa43ab613701cbf094e0aa91e6526112 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Till Kamppeter <till.kamppeter@gmail.com>
|
||||||
|
Date: Tue, 8 Oct 2019 23:38:54 +0200
|
||||||
|
Subject: [PATCH] gstoraster: Use ".setfilladjust2" PostScript command for
|
||||||
|
Center-of-Pixel method to fill paths.
|
||||||
|
|
||||||
|
---
|
||||||
|
NEWS | 6 ++++++
|
||||||
|
filter/gstoraster.c | 2 +-
|
||||||
|
2 files changed, 7 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/filter/gstoraster.c b/filter/gstoraster.c
|
||||||
|
index 4aec0799..59f39927 100644
|
||||||
|
--- a/filter/gstoraster.c
|
||||||
|
+++ b/filter/gstoraster.c
|
||||||
|
@@ -895,7 +895,7 @@ main (int argc, char **argv, char *envp[])
|
||||||
|
(t && (!strcasecmp(t, "true") || !strcasecmp(t, "on") ||
|
||||||
|
!strcasecmp(t, "yes")))) {
|
||||||
|
fprintf(stderr, "DEBUG: Ghostscript using Center-of-Pixel method to fill paths.\n");
|
||||||
|
- cupsArrayAdd(gs_args, strdup("0 .setfilladjust"));
|
||||||
|
+ cupsArrayAdd(gs_args, strdup("0 0 .setfilladjust2"));
|
||||||
|
} else
|
||||||
|
fprintf(stderr, "DEBUG: Ghostscript using Any-Part-of-Pixel method to fill paths.\n");
|
||||||
|
|
||||||
|
--
|
||||||
|
2.26.2
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
diff --git a/filter/foomatic-rip/foomaticrip.c b/filter/foomatic-rip/foomaticrip.c
|
||||||
|
index 7dc2426..146125f 100644
|
||||||
|
--- a/filter/foomatic-rip/foomaticrip.c
|
||||||
|
+++ b/filter/foomatic-rip/foomaticrip.c
|
||||||
|
@@ -672,6 +672,12 @@ int print_file(const char *filename, int convert)
|
||||||
|
if (out != NULL)
|
||||||
|
fclose(out);
|
||||||
|
|
||||||
|
+ // Delete temp file if we created one
|
||||||
|
+ if ( *tmpfilename ) {
|
||||||
|
+ _log("Removing temporary file %s\n", tmpfilename);
|
||||||
|
+ unlink(tmpfilename);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,459 @@
|
||||||
|
--- cups-filters-1.20.0/filter/pdf.cxx
|
||||||
|
+++ cups-filters-1.20.0/filter/pdf.cxx
|
||||||
|
@@ -87,7 +87,11 @@ static EMB_PARAMS *Font;
|
||||||
|
extern "C" pdf_t * pdf_load_template(const char *filename)
|
||||||
|
{
|
||||||
|
/* Init poppler */
|
||||||
|
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 83
|
||||||
|
+ globalParams.reset(new GlobalParams());
|
||||||
|
+#else
|
||||||
|
globalParams = new GlobalParams();
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
PDFDoc *doc = new PDFDoc(new GooString(filename));
|
||||||
|
|
||||||
|
@@ -136,7 +140,7 @@ extern "C" void pdf_prepend_stream(pdf_t
|
||||||
|
#endif
|
||||||
|
if (!pageobj.isDict() ||
|
||||||
|
#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||||
|
- (contents = pageobj.dictLookupNF("Contents")).isNull()
|
||||||
|
+ (contents = pageobj.dictLookupNF("Contents").copy()).isNull()
|
||||||
|
#else
|
||||||
|
!pageobj.dictLookupNF("Contents", &contents)
|
||||||
|
#endif
|
||||||
|
@@ -166,11 +170,15 @@ extern "C" void pdf_prepend_stream(pdf_t
|
||||||
|
#endif
|
||||||
|
|
||||||
|
r = xref->addIndirectObject(&stream);
|
||||||
|
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 75
|
||||||
|
+ streamrefobj = Object(r);
|
||||||
|
+#else
|
||||||
|
#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||||
|
streamrefobj = Object(r.num, r.gen);
|
||||||
|
#else
|
||||||
|
streamrefobj.initRef(r.num, r.gen);
|
||||||
|
#endif
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||||
|
array = Object(new Array(xref));
|
||||||
|
@@ -182,7 +190,7 @@ extern "C" void pdf_prepend_stream(pdf_t
|
||||||
|
|
||||||
|
if (contents.isStream()) {
|
||||||
|
#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||||
|
- contents = pageobj.dictLookupNF("Contents"); // streams must be indirect, i.e. not fetch()-ed
|
||||||
|
+ contents = pageobj.dictLookupNF("Contents").copy(); // streams must be indirect, i.e. not fetch()-ed
|
||||||
|
array.arrayAdd(std::move(contents));
|
||||||
|
#else
|
||||||
|
pageobj.dictLookupNF("Contents", &contents); // streams must be indirect, i.e. not fetch()-ed
|
||||||
|
@@ -194,7 +202,7 @@ extern "C" void pdf_prepend_stream(pdf_t
|
||||||
|
Object obj;
|
||||||
|
for (i = 0; i < len; i++) {
|
||||||
|
#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||||
|
- obj = contents.arrayGetNF(i);
|
||||||
|
+ obj = contents.arrayGetNF(i).copy();
|
||||||
|
array.arrayAdd(std::move(obj));
|
||||||
|
#else
|
||||||
|
contents.arrayGetNF(i, &obj);
|
||||||
|
@@ -258,7 +266,7 @@ static Object * get_resource_dict(XRef *
|
||||||
|
|
||||||
|
/* TODO resource dict can also be inherited */
|
||||||
|
#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||||
|
- res = pagedict->lookupNF("Resources");
|
||||||
|
+ res = pagedict->lookupNF("Resources").copy();
|
||||||
|
if (res.isNull())
|
||||||
|
#else
|
||||||
|
if (!pagedict->lookupNF("Resources", &res))
|
||||||
|
@@ -331,7 +339,7 @@ extern "C" void pdf_add_type1_font(pdf_t
|
||||||
|
xref->addIndirectObject(&font);
|
||||||
|
|
||||||
|
#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||||
|
- fonts = resdict.dictLookupNF("Font");
|
||||||
|
+ fonts = resdict.dictLookupNF("Font").copy();
|
||||||
|
#else
|
||||||
|
resdict.dictLookupNF("Font", &fonts);
|
||||||
|
#endif
|
||||||
|
@@ -540,7 +548,7 @@ extern "C" void pdf_duplicate_page (pdf_
|
||||||
|
}
|
||||||
|
|
||||||
|
#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||||
|
- parentref = page.dictLookupNF("Parent");
|
||||||
|
+ parentref = page.dictLookupNF("Parent").copy();
|
||||||
|
parent = parentref.fetch(xref);
|
||||||
|
#else
|
||||||
|
page.dictLookupNF("Parent", &parentref);
|
||||||
|
@@ -568,6 +576,9 @@ extern "C" void pdf_duplicate_page (pdf_
|
||||||
|
// the pages tree (not supported by major pdf implementations).
|
||||||
|
for (i = 1; i < count; i++) {
|
||||||
|
Ref r = xref->addIndirectObject(&page);
|
||||||
|
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 75
|
||||||
|
+ kids.arrayAdd(Object(r));
|
||||||
|
+#else
|
||||||
|
#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||||
|
kids.arrayAdd(Object(r.num, r.gen));
|
||||||
|
#else
|
||||||
|
@@ -575,6 +586,7 @@ extern "C" void pdf_duplicate_page (pdf_
|
||||||
|
kids.arrayAdd(&ref);
|
||||||
|
ref.free();
|
||||||
|
#endif
|
||||||
|
+#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||||
|
@@ -734,7 +746,7 @@ extern "C" int pdf_fill_form(pdf_t *doc,
|
||||||
|
}
|
||||||
|
|
||||||
|
FormField *ff = fm_text->getField();
|
||||||
|
- GooString *field_name;
|
||||||
|
+ const GooString *field_name;
|
||||||
|
field_name = ff->getFullyQualifiedName();
|
||||||
|
if ( ! field_name )
|
||||||
|
field_name = ff->getPartialName();
|
||||||
|
@@ -743,7 +755,11 @@ extern "C" int pdf_fill_form(pdf_t *doc,
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 72
|
||||||
|
+ const char *name = field_name->c_str();
|
||||||
|
+#else
|
||||||
|
const char *name = field_name->getCString();
|
||||||
|
+#endif
|
||||||
|
const char *fill_with = lookup_opt(opt, name);
|
||||||
|
if ( ! fill_with ) {
|
||||||
|
fprintf(stderr, "Lack information for widget: %s.\n", name);
|
||||||
|
@@ -831,6 +847,9 @@ extern "C" int pdf_fill_form(pdf_t *doc,
|
||||||
|
appearance_stream_dic.dictSet("Type", name_object("XObject"));
|
||||||
|
appearance_stream_dic.dictSet("Subtype", name_object("Form"));
|
||||||
|
appearance_stream_dic.dictSet("FormType", int_object(1));
|
||||||
|
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 75
|
||||||
|
+ appearance_stream_dic.dictSet("Resources", Object(resref));
|
||||||
|
+#else
|
||||||
|
#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||||
|
appearance_stream_dic.dictSet("Resources", Object(resref.num, resref.gen));
|
||||||
|
#else
|
||||||
|
@@ -838,6 +857,7 @@ extern "C" int pdf_fill_form(pdf_t *doc,
|
||||||
|
obj_ref_x.initRef(resref.num, resref.gen);
|
||||||
|
appearance_stream_dic.dictSet("Resources", &obj_ref_x);
|
||||||
|
#endif
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
/* BBox array: TODO. currently out of the head. */
|
||||||
|
Object array;
|
||||||
|
@@ -851,8 +871,13 @@ extern "C" int pdf_fill_form(pdf_t *doc,
|
||||||
|
appearance_stream_dic.dictSet("BBox", std::move(array));
|
||||||
|
appearance_stream_dic.dictSet("Length", Object(appearance_stream->getLength()));
|
||||||
|
|
||||||
|
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 72
|
||||||
|
+ MemStream *mem_stream = new MemStream(appearance_stream->c_str(),
|
||||||
|
+ 0, appearance_stream->getLength(), std::move(appearance_stream_dic));
|
||||||
|
+#else
|
||||||
|
MemStream *mem_stream = new MemStream(appearance_stream->getCString(),
|
||||||
|
0, appearance_stream->getLength(), std::move(appearance_stream_dic));
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
/* Make obj stream */
|
||||||
|
Object stream = Object(static_cast<Stream *>(mem_stream));
|
||||||
|
@@ -860,8 +885,11 @@ extern "C" int pdf_fill_form(pdf_t *doc,
|
||||||
|
Ref r = xref->addIndirectObject(&stream);
|
||||||
|
|
||||||
|
/* Update Xref table */
|
||||||
|
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 75
|
||||||
|
+ Object obj_ref = Object(r);
|
||||||
|
+#else
|
||||||
|
Object obj_ref = Object(r.num, r.gen);
|
||||||
|
-
|
||||||
|
+#endif
|
||||||
|
/*
|
||||||
|
* Fill Annotation's appearance streams dic /AP
|
||||||
|
* See: 8.4.4 Appearance Streams
|
||||||
|
@@ -884,8 +912,13 @@ extern "C" int pdf_fill_form(pdf_t *doc,
|
||||||
|
appearance_stream_dic.dictSet("BBox", &array);
|
||||||
|
appearance_stream_dic.dictSet("Length", int_object(appearance_stream->getLength()));
|
||||||
|
|
||||||
|
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 72
|
||||||
|
+ MemStream *mem_stream = new MemStream(appearance_stream->c_str(),
|
||||||
|
+ 0, appearance_stream->getLength(), &appearance_stream_dic);
|
||||||
|
+#else
|
||||||
|
MemStream *mem_stream = new MemStream(appearance_stream->getCString(),
|
||||||
|
0, appearance_stream->getLength(), &appearance_stream_dic);
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
/* Make obj stream */
|
||||||
|
Object stream;
|
||||||
|
@@ -925,10 +958,10 @@ extern "C" int pdf_fill_form(pdf_t *doc,
|
||||||
|
*/
|
||||||
|
Object *obj_form = catalog->getAcroForm();
|
||||||
|
#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||||
|
- obj_form->dictSet("NeedAppearances", Object(gFalse));
|
||||||
|
+ obj_form->dictSet("NeedAppearances", Object(false));
|
||||||
|
#else
|
||||||
|
Object obj1;
|
||||||
|
- obj1.initBool(gFalse);
|
||||||
|
+ obj1.initBool(false);
|
||||||
|
obj_form->dictSet("NeedAppearances", &obj1);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
@@ -948,7 +981,11 @@ extern "C" int pdf_fill_form(pdf_t *doc,
|
||||||
|
catRef.gen = xref->getRootGen();
|
||||||
|
catRef.num = xref->getRootNum();
|
||||||
|
#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||||
|
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 75
|
||||||
|
+ catObj.dictSet("AcroForm", Object(ref_form));
|
||||||
|
+#else
|
||||||
|
catObj.dictSet("AcroForm", Object(ref_form.num, ref_form.gen));
|
||||||
|
+#endif
|
||||||
|
xref->setModifiedObject(&catObj, catRef);
|
||||||
|
#else
|
||||||
|
Object obj2;
|
||||||
|
@@ -1020,12 +1057,22 @@ static int pdf_embed_font(pdf_t *doc,
|
||||||
|
|
||||||
|
/* Create memory stream font. Add it to font dic. */
|
||||||
|
#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||||
|
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 72
|
||||||
|
+ MemStream *mem_stream = new MemStream(font_stream->c_str(),
|
||||||
|
+ 0, outlen, std::move(f_dic));
|
||||||
|
+#else
|
||||||
|
MemStream *mem_stream = new MemStream(font_stream->getCString(),
|
||||||
|
0, outlen, std::move(f_dic));
|
||||||
|
+#endif
|
||||||
|
Object stream = Object(static_cast<Stream *>(mem_stream));
|
||||||
|
#else
|
||||||
|
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 72
|
||||||
|
+ MemStream *mem_stream = new MemStream(font_stream->c_str(),
|
||||||
|
+ 0, outlen, &f_dic);
|
||||||
|
+#else
|
||||||
|
MemStream *mem_stream = new MemStream(font_stream->getCString(),
|
||||||
|
0, outlen, &f_dic);
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
/* Make obj stream */
|
||||||
|
Object stream;
|
||||||
|
@@ -1066,7 +1113,7 @@ static int pdf_embed_font(pdf_t *doc,
|
||||||
|
Object fonts;
|
||||||
|
|
||||||
|
#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||||
|
- fonts = resdict.dictLookupNF("Font");
|
||||||
|
+ fonts = resdict.dictLookupNF("Font").copy();
|
||||||
|
#else
|
||||||
|
resdict.dictLookupNF("Font", &fonts);
|
||||||
|
#endif
|
||||||
|
@@ -1074,7 +1121,7 @@ static int pdf_embed_font(pdf_t *doc,
|
||||||
|
/* Create new one, if doesn't exists */
|
||||||
|
#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||||
|
resdict.dictSet("Font", Object(new Dict(xref)));
|
||||||
|
- fonts = resdict.dictLookupNF("Font");
|
||||||
|
+ fonts = resdict.dictLookupNF("Font").copy();
|
||||||
|
#else
|
||||||
|
fonts.initDict(xref);
|
||||||
|
resdict.dictSet("Font", &fonts);
|
||||||
|
@@ -1108,11 +1155,15 @@ static int pdf_embed_font(pdf_t *doc,
|
||||||
|
|
||||||
|
/* r - cid resource dic */
|
||||||
|
Object font_res_obj_ref;
|
||||||
|
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 75
|
||||||
|
+ font_res_obj_ref = Object(r);
|
||||||
|
+#else
|
||||||
|
#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||||
|
font_res_obj_ref = Object(r.num, r.gen);
|
||||||
|
#else
|
||||||
|
font_res_obj_ref.initRef(r.num, r.gen);
|
||||||
|
#endif
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
Object *fonts_dic;
|
||||||
|
Object dereferenced_obj;
|
||||||
|
@@ -1440,6 +1491,9 @@ static Object *make_fontdescriptor_dic(
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 75
|
||||||
|
+ dic->dictSet(emb_pdf_get_fontfile_key(emb), Object(fontfile_obj_ref));
|
||||||
|
+#else
|
||||||
|
#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||||
|
dic->dictSet(emb_pdf_get_fontfile_key(emb), Object(fontfile_obj_ref.num, fontfile_obj_ref.gen));
|
||||||
|
#else
|
||||||
|
@@ -1447,6 +1501,7 @@ static Object *make_fontdescriptor_dic(
|
||||||
|
ref_obj.initRef(fontfile_obj_ref.num, fontfile_obj_ref.gen);
|
||||||
|
dic->dictSet(emb_pdf_get_fontfile_key(emb), &ref_obj);
|
||||||
|
#endif
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
return dic;
|
||||||
|
}
|
||||||
|
@@ -1480,6 +1535,9 @@ static Object *make_font_dic(
|
||||||
|
"BaseFont",
|
||||||
|
name_object(copyString(emb_pdf_escape_name(fdes->fontname,-1))));
|
||||||
|
|
||||||
|
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 75
|
||||||
|
+ dic->dictSet("FontDescriptor", Object(fontdescriptor_obj_ref));
|
||||||
|
+#else
|
||||||
|
#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||||
|
dic->dictSet("FontDescriptor", Object(fontdescriptor_obj_ref.num, fontdescriptor_obj_ref.gen));
|
||||||
|
#else
|
||||||
|
@@ -1487,6 +1545,7 @@ static Object *make_font_dic(
|
||||||
|
ref_obj.initRef(fontdescriptor_obj_ref.num, fontdescriptor_obj_ref.gen);
|
||||||
|
dic->dictSet("FontDescriptor", &ref_obj);
|
||||||
|
#endif
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
if ( emb->plan & EMB_A_MULTIBYTE ) {
|
||||||
|
assert(fwid->warray);
|
||||||
|
@@ -1573,17 +1632,26 @@ static Object *make_cidfont_dic(
|
||||||
|
basefont->append(addenc);
|
||||||
|
basefont->append((addenc[0])?encoding:"");
|
||||||
|
|
||||||
|
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 72
|
||||||
|
+ dic->dictSet("BaseFont",
|
||||||
|
+ name_object(copyString(basefont->c_str())));
|
||||||
|
+#else
|
||||||
|
dic->dictSet("BaseFont",
|
||||||
|
name_object(copyString(basefont->getCString())));
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
dic->dictSet("Encoding", name_object(copyString(encoding)));
|
||||||
|
|
||||||
|
Object obj;
|
||||||
|
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 75
|
||||||
|
+ obj = Object(fontdescriptor_obj_ref);
|
||||||
|
+#else
|
||||||
|
#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||||
|
obj = Object(fontdescriptor_obj_ref.num, fontdescriptor_obj_ref.gen);
|
||||||
|
#else
|
||||||
|
obj.initRef(fontdescriptor_obj_ref.num, fontdescriptor_obj_ref.gen);
|
||||||
|
#endif
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
Object array;
|
||||||
|
#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||||
|
--- cups-filters-1.20.0/filter/pdftoraster.cxx
|
||||||
|
+++ cups-filters-1.20.0/filter/pdftoraster.cxx
|
||||||
|
@@ -282,8 +282,13 @@ cmsHPROFILE sgray_profile()
|
||||||
|
|
||||||
|
#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 19
|
||||||
|
#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 23
|
||||||
|
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 85
|
||||||
|
+void CDECL myErrorFun(ErrorCategory category,
|
||||||
|
+ Goffset pos, const char *msg)
|
||||||
|
+#else
|
||||||
|
void CDECL myErrorFun(void *data, ErrorCategory category,
|
||||||
|
Goffset pos, char *msg)
|
||||||
|
+#endif
|
||||||
|
#else
|
||||||
|
void CDECL myErrorFun(void *data, ErrorCategory category,
|
||||||
|
int pos, char *msg)
|
||||||
|
@@ -412,9 +417,9 @@ static GBool getColorProfilePath(ppd_fil
|
||||||
|
path->append("/profiles/");
|
||||||
|
}
|
||||||
|
path->append(attr->value);
|
||||||
|
- return gTrue;
|
||||||
|
+ return true;
|
||||||
|
}
|
||||||
|
- return gFalse;
|
||||||
|
+ return false;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
@@ -1686,7 +1691,7 @@ static void outPage(PDFDoc *doc, Catalog
|
||||||
|
{
|
||||||
|
SplashBitmap *bitmap;
|
||||||
|
Page *page = catalog->getPage(pageNo);
|
||||||
|
- PDFRectangle *mediaBox = page->getMediaBox();
|
||||||
|
+ const PDFRectangle *mediaBox = page->getMediaBox();
|
||||||
|
int rotate = page->getRotate();
|
||||||
|
double paperdimensions[2], /* Physical size of the paper */
|
||||||
|
margins[4]; /* Physical margins of print */
|
||||||
|
@@ -1814,7 +1819,7 @@ static void outPage(PDFDoc *doc, Catalog
|
||||||
|
|
||||||
|
doc->displayPage(out,pageNo,header.HWResolution[0],
|
||||||
|
header.HWResolution[1],(landscape == 0 ? 0 : 90),
|
||||||
|
- gTrue,gTrue,gTrue);
|
||||||
|
+ true,true,true);
|
||||||
|
bitmap = out->getBitmap();
|
||||||
|
bitmapoffset[0] = margins[0] / 72.0 * header.HWResolution[0];
|
||||||
|
bitmapoffset[1] = margins[3] / 72.0 * header.HWResolution[1];
|
||||||
|
@@ -1867,7 +1872,7 @@ static void outPage(PDFDoc *doc, Catalog
|
||||||
|
writePageImage(raster,bitmap,pageNo);
|
||||||
|
}
|
||||||
|
|
||||||
|
-static void setPopplerColorProfile()
|
||||||
|
+static void setPopplerColorProfile(SplashOutputDev *out)
|
||||||
|
{
|
||||||
|
if (header.cupsBitsPerColor != 8 && header.cupsBitsPerColor != 16) {
|
||||||
|
/* color Profile is not supported */
|
||||||
|
@@ -1951,7 +1956,13 @@ static void setPopplerColorProfile()
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (popplerColorProfile != NULL) {
|
||||||
|
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 90
|
||||||
|
+#ifdef USE_CMS
|
||||||
|
+ out->setDisplayProfile(make_GfxLCMSProfilePtr(popplerColorProfile));
|
||||||
|
+#endif
|
||||||
|
+#else
|
||||||
|
GfxColorSpace::setDisplayProfile(popplerColorProfile);
|
||||||
|
+#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -1966,13 +1977,21 @@ int main(int argc, char *argv[]) {
|
||||||
|
int rowpad;
|
||||||
|
Catalog *catalog;
|
||||||
|
|
||||||
|
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 85
|
||||||
|
+ setErrorCallback(::myErrorFun);
|
||||||
|
+#else
|
||||||
|
#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 19
|
||||||
|
setErrorCallback(::myErrorFun,NULL);
|
||||||
|
#else
|
||||||
|
setErrorFunction(::myErrorFun);
|
||||||
|
#endif
|
||||||
|
+#endif
|
||||||
|
cmsSetLogErrorHandler(lcmsErrorHandler);
|
||||||
|
- globalParams = new GlobalParams();
|
||||||
|
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 83
|
||||||
|
+ globalParams.reset(new GlobalParams());
|
||||||
|
+#else
|
||||||
|
+ globalParams = new GlobalParams();
|
||||||
|
+#endif
|
||||||
|
parseOpts(argc, argv);
|
||||||
|
|
||||||
|
if (argc == 6) {
|
||||||
|
@@ -2119,14 +2138,10 @@ int main(int argc, char *argv[]) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
- if (!cm_disabled) {
|
||||||
|
- setPopplerColorProfile();
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
out = new SplashOutputDev(cmode,rowpad/* row padding */,
|
||||||
|
- gFalse,paperColor,gTrue
|
||||||
|
+ false,paperColor,true
|
||||||
|
#if POPPLER_VERSION_MAJOR == 0 && POPPLER_VERSION_MINOR <= 30
|
||||||
|
- ,gFalse
|
||||||
|
+ ,false
|
||||||
|
#endif
|
||||||
|
);
|
||||||
|
#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 19
|
||||||
|
@@ -2135,6 +2150,10 @@ int main(int argc, char *argv[]) {
|
||||||
|
out->startDoc(doc->getXRef());
|
||||||
|
#endif
|
||||||
|
|
||||||
|
+ if (!cm_disabled) {
|
||||||
|
+ setPopplerColorProfile(out);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
if ((raster = cupsRasterOpen(1, pwgraster ? CUPS_RASTER_WRITE_PWG :
|
||||||
|
CUPS_RASTER_WRITE)) == 0) {
|
||||||
|
pdfError(-1,const_cast<char *>("Can't open raster stream"));
|
||||||
|
@@ -2162,9 +2181,11 @@ err1:
|
||||||
|
cmsDeleteTransform(colorTransform);
|
||||||
|
}
|
||||||
|
|
||||||
|
+#if POPPLER_VERSION_MAJOR == 0 && POPPLER_VERSION_MINOR <= 68
|
||||||
|
// Check for memory leaks
|
||||||
|
Object::memCheck(stderr);
|
||||||
|
gMemReport(stderr);
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
return exitCode;
|
||||||
|
}
|
|
@ -4,7 +4,7 @@
|
||||||
Summary: OpenPrinting CUPS filters and backends
|
Summary: OpenPrinting CUPS filters and backends
|
||||||
Name: cups-filters
|
Name: cups-filters
|
||||||
Version: 1.20.0
|
Version: 1.20.0
|
||||||
Release: 20%{?dist}
|
Release: 24%{?dist}
|
||||||
|
|
||||||
# For a breakdown of the licensing, see COPYING file
|
# For a breakdown of the licensing, see COPYING file
|
||||||
# GPLv2: filters: commandto*, imagetoraster, pdftops, rasterto*,
|
# GPLv2: filters: commandto*, imagetoraster, pdftops, rasterto*,
|
||||||
|
@ -43,6 +43,12 @@ Patch08: cups-browsed-socket-leak.patch
|
||||||
Patch09: cups-browsed-error-messages.patch
|
Patch09: cups-browsed-error-messages.patch
|
||||||
# 1813229 - cups-browsed leaks memory
|
# 1813229 - cups-browsed leaks memory
|
||||||
Patch10: cups-browsed-memory-leaks.patch
|
Patch10: cups-browsed-memory-leaks.patch
|
||||||
|
# 1891681 - [RHEL 8] foomatic-rip files up /var/spool/tmp with temporary files
|
||||||
|
Patch11: foomatic-remove-tmpfile.patch
|
||||||
|
# 1889798 - Rebuild cups-filters due to rebase of poppler
|
||||||
|
Patch12: poppler-20.11.0.patch
|
||||||
|
# 1894543 - Fix '.setfilladjust' usage after gs upgrade to 9.27
|
||||||
|
Patch13: 0001-gstoraster-Use-.setfilladjust2-PostScript-command-fo.patch
|
||||||
|
|
||||||
Requires: cups-filters-libs%{?_isa} = %{version}-%{release}
|
Requires: cups-filters-libs%{?_isa} = %{version}-%{release}
|
||||||
|
|
||||||
|
@ -97,7 +103,10 @@ Requires: cups-filesystem
|
||||||
# poppler required for banner printing and with ghostscript needed when project
|
# poppler required for banner printing and with ghostscript needed when project
|
||||||
# is configured with --with-pdftops=hybrid
|
# is configured with --with-pdftops=hybrid
|
||||||
Requires: poppler-utils
|
Requires: poppler-utils
|
||||||
Requires: ghostscript
|
# 1894543 - just to make sure our filter will work if there is a case when cups-filters
|
||||||
|
# is updated alone and ghostscript isn't updated. This requirement will make sure we will
|
||||||
|
# bring along a new ghostscript too.
|
||||||
|
Requires: ghostscript%{?_isa} >= 0:9.27-1
|
||||||
|
|
||||||
# texttopdf
|
# texttopdf
|
||||||
Requires: liberation-mono-fonts
|
Requires: liberation-mono-fonts
|
||||||
|
@ -120,8 +129,11 @@ Recommends: cups-ipptool
|
||||||
# older installations can still have ghostscript-cups and foomatic-filters
|
# older installations can still have ghostscript-cups and foomatic-filters
|
||||||
# installed, but they are replaced by cups-filters now. We need to obsolete
|
# installed, but they are replaced by cups-filters now. We need to obsolete
|
||||||
# them to have them uninstalled (#1632268)
|
# them to have them uninstalled (#1632268)
|
||||||
Obsoletes: ghostscript-cups
|
# rpm complains about unversioned Obsoletes - use NVR bigger than is in RHEL7
|
||||||
Obsoletes: foomatic-filters
|
# to make the upgrade to RHEL8 work even if RHEL7 obsoleted packages
|
||||||
|
# get an update
|
||||||
|
Obsoletes: ghostscript-cups < 9.26-1
|
||||||
|
Obsoletes: foomatic-filters < 4.0.10-1
|
||||||
|
|
||||||
%package libs
|
%package libs
|
||||||
Summary: OpenPrinting CUPS filters and backends - cupsfilters and fontembed libraries
|
Summary: OpenPrinting CUPS filters and backends - cupsfilters and fontembed libraries
|
||||||
|
@ -169,6 +181,12 @@ This is the development package for OpenPrinting CUPS filters and backends.
|
||||||
%patch09 -p1 -b .cups-browsed-error-messages
|
%patch09 -p1 -b .cups-browsed-error-messages
|
||||||
# 1813229 - cups-browsed leaks memory
|
# 1813229 - cups-browsed leaks memory
|
||||||
%patch10 -p1 -b .cups-browsed-memory-leak
|
%patch10 -p1 -b .cups-browsed-memory-leak
|
||||||
|
# 1891681 - [RHEL 8] foomatic-rip files up /var/spool/tmp with temporary files
|
||||||
|
%patch11 -p1 -b .remove-tmpfile
|
||||||
|
# 1889798 - Rebuild cups-filters due to rebase of poppler
|
||||||
|
%patch12 -p1 -b .poppler2011
|
||||||
|
# 1894543 - Fix '.setfilladjust' usage after gs upgrade to 9.27
|
||||||
|
%patch13 -p1 -b .setfilladjust
|
||||||
|
|
||||||
%build
|
%build
|
||||||
# work-around Rpath
|
# work-around Rpath
|
||||||
|
@ -315,6 +333,18 @@ make check
|
||||||
%{_libdir}/libfontembed.so
|
%{_libdir}/libfontembed.so
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Dec 14 2020 Zdenek Dohnal <zdohnal@redhat.com> - 1.20.0-24
|
||||||
|
- require the explicit gs version
|
||||||
|
|
||||||
|
* Tue Dec 08 2020 Zdenek Dohnal <zdohnal@redhat.com> - 1.20.0-23
|
||||||
|
- 1894543 - Fix '.setfilladjust' usage after gs upgrade to 9.27
|
||||||
|
|
||||||
|
* Wed Nov 18 2020 Zdenek Dohnal <zdohnal@redhat.com> - 1.20.0-22
|
||||||
|
- 1889798 - Rebuild cups-filters due to rebase of poppler
|
||||||
|
|
||||||
|
* Tue Oct 27 2020 Zdenek Dohnal <zdohnal@redhat.com> - 1.20.0-21
|
||||||
|
- 1891681 - [RHEL 8] foomatic-rip files up /var/spool/tmp with temporary files
|
||||||
|
|
||||||
* Wed Apr 08 2020 Zdenek Dohnal <zdohnal@redhat.com> - 1.20.0-20
|
* Wed Apr 08 2020 Zdenek Dohnal <zdohnal@redhat.com> - 1.20.0-20
|
||||||
- 1813229 - cups-browsed leaks memory
|
- 1813229 - cups-browsed leaks memory
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue