public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/libcupsfilters] rawhide: fix multiple copies not working for raster drivers (rhbz#2312145)
@ 2026-09-07 12:28 Zdenek Dohnal
  0 siblings, 0 replies; only message in thread
From: Zdenek Dohnal @ 2026-09-07 12:28 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/libcupsfilters
Branch : rawhide
Commit : 12abdf1e51fffc865efa96a569055c21b6ca3e80
Author : Zdenek Dohnal <zdohnal@redhat.com>
Date   : 2026-09-04T09:24:25+02:00
Stats  : +49/-1 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/libcupsfilters/c/12abdf1e51fffc865efa96a569055c21b6ca3e80?branch=rawhide

Log:
fix multiple copies not working for raster drivers (rhbz#2312145)

---
diff --git a/0001-Honor-data-copies-in-cfFilterPDFToPDF.patch b/0001-Honor-data-copies-in-cfFilterPDFToPDF.patch
new file mode 100644
index 0000000..8ef780c
--- /dev/null
+++ b/0001-Honor-data-copies-in-cfFilterPDFToPDF.patch
@@ -0,0 +1,43 @@
+From 4c06f1bc2f090b487a71a9287c6eb54ce2827f7b Mon Sep 17 00:00:00 2001
+From: hakibro <sandalkuganti@gmail.com>
+Date: Tue, 1 Sep 2026 10:58:43 +0700
+Subject: [PATCH] Honor data->copies in cfFilterPDFToPDF
+
+CUPS passes the copy count via the standard 'copies' filter argument
+(argv[4], exposed as data->copies) and strips the 'copies' option from
+the options string (argv[5]).  cfFilterOptionsCreate() only reads the
+copy count from the options string, so it defaults to 1 and the
+requested number of copies is lost.
+
+For raster drivers that go through the 'universal' filter this means
+'print N copies' always prints a single copy.
+
+Honor data->copies as a fallback when no explicit copies option was
+given.
+
+Fixes #227
+---
+ cupsfilters/pdftopdf.c | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/cupsfilters/pdftopdf.c b/cupsfilters/pdftopdf.c
+index 894500343..f5397f479 100644
+--- a/cupsfilters/pdftopdf.c
++++ b/cupsfilters/pdftopdf.c
+@@ -2777,6 +2777,16 @@ cfFilterPDFToPDF(int inputfd,
+ 
+   filter_options = cfFilterOptionsCreate(data->num_options, data->options);
+ 
++  // CUPS passes the copy count through the standard "copies" filter argument
++  // (argv[4], exposed here as data->copies) and strips the "copies" option
++  // from the options string (argv[5]).  cfFilterOptionsCreate() only reads
++  // the copy count from the options string, so it defaults to 1 and the
++  // requested number of copies is lost.  Honor data->copies as a fallback so
++  // that printing multiple copies works for raster drivers going through the
++  // "universal" filter.
++  if (data->copies > 1 && filter_options->copies <= 1)
++    filter_options->copies = data->copies;
++
+   char temp_filename[] = "/tmp/tempfileXXXXXX";
+   int temp_fd = mkstemp(temp_filename);
+   if (temp_fd == -1)

diff --git a/libcupsfilters.spec b/libcupsfilters.spec
index 35b6a05..1b3f3fc 100644
--- a/libcupsfilters.spec
+++ b/libcupsfilters.spec
@@ -7,7 +7,7 @@
 Name: libcupsfilters
 Epoch: 1
 Version: 2.2.1
-Release: 2%{?dist}
+Release: 3%{?dist}
 Summary: Library for developing printing filters
 # the CUPS exception text is the same as LLVM exception, so using that name with
 # agreement from legal team
@@ -21,6 +21,8 @@ Patch001: 0001-pclmtoraster.c-Fix-getting-MediaBox-from-input.patch
 Patch002: 0001-pclmtoraster.c-Fix-processing-image-in-PCLm.patch
 # https://github.com/OpenPrinting/libcupsfilters/pull/167/commits/a9acdb22cc898076bf6c5d9d20474274ed123458
 Patch003: 0001-Fix-printing-error-pdfio-output-Missing-Root-object..patch
+# https://github.com/OpenPrinting/libcupsfilters/pull/228
+Patch004: 0001-Honor-data-copies-in-cfFilterPDFToPDF.patch
 
 
 # for generating configure and Makefile scripts in autogen.h
@@ -206,6 +208,9 @@ rm -f %{buildroot}%{_pkgdocdir}/{LICENSE,COPYING,NOTICE}
 
 
 %changelog
+* Fri Sep 04 2026 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.2.1-3
+- fix multiple copies not working for raster drivers (rhbz#2312145)
+
 * Wed Aug 19 2026 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.2.1-2
 - fix printing of PDF which lack Root object
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-09-07 12:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-07 12:28 [rpms/libcupsfilters] rawhide: fix multiple copies not working for raster drivers (rhbz#2312145) Zdenek Dohnal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox