[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1057239: bookworm-pu: cups/2.4.2-3+deb12u5



Package: release.debian.org
Severity: normal
Tags: bookworm
User: release.debian.org@packages.debian.org
Usertags: pu


The attached debdiff for cups fixes a nasty bug in Bookworm.
If the PPD file for a printer has a ColorModel option and the only choice for printing in color is not named RGB but CMYK instead, the printer cannot be made printing in color with intuitive methods, usually by selecting the color choice in the print dialog.

The fix was already applied in Unstable/Testing and also uploaded to Ubuntu-Lunar and seems to work as expected.

  Thorsten
diff -Nru cups-2.4.2/debian/changelog cups-2.4.2/debian/changelog
--- cups-2.4.2/debian/changelog	2023-10-05 16:35:27.000000000 +0200
+++ cups-2.4.2/debian/changelog	2023-12-01 20:35:27.000000000 +0100
@@ -1,3 +1,15 @@
+cups (2.4.2-3+deb12u5) bookworm; urgency=medium
+
+  * 0017-check-colormodel-also-for-CMYK.patch
+    Take into account that on some printers the ColorModel option's
+    choice for color printing is CMYK and not RGB.
+  * 0018-dont-override-color-settings-from-print-dialoag.patch
+    Prioritize the ColorModel PPD file option over the print-color-mode
+    IPP attribute. (Closes: #1056581)
+    (Thanks a lot to Till Kamppeter for the patches)
+
+ -- Thorsten Alteholz <debian@alteholz.de>  Fri, 01 Dec 2023 20:35:27 +0100
+
 cups (2.4.2-3+deb12u4) bookworm; urgency=medium
 
   * remove debian/NEWS again to avoid too much information when only
diff -Nru cups-2.4.2/debian/patches/0017-check-colormodel-also-for-CMYK.patch cups-2.4.2/debian/patches/0017-check-colormodel-also-for-CMYK.patch
--- cups-2.4.2/debian/patches/0017-check-colormodel-also-for-CMYK.patch	1970-01-01 01:00:00.000000000 +0100
+++ cups-2.4.2/debian/patches/0017-check-colormodel-also-for-CMYK.patch	2023-12-01 20:35:27.000000000 +0100
@@ -0,0 +1,21 @@
+From: Thorsten Alteholz <debian@alteholz.de>
+Date: Sat, 2 Dec 2023 00:00:38 +0100
+Subject: check colormodel also for CMYK
+
+---
+ scheduler/printers.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/scheduler/printers.c b/scheduler/printers.c
+index 4efa613..2fbdaad 100644
+--- a/scheduler/printers.c
++++ b/scheduler/printers.c
+@@ -4509,7 +4509,7 @@ load_ppd(cupsd_printer_t *p)		/* I - Printer */
+         ppd_option_t *color_model = ppdFindOption(ppd, "ColorModel");
+ 					// ColorModel PPD option
+ 
+-        if (color_model && strcmp(color_model->defchoice, "RGB"))
++        if (color_model && strcmp(color_model->defchoice, "RGB") && strcmp(color_model->defchoice, "CMYK"))
+           p->num_options = cupsAddOption("print-color-mode", "monochrome", p->num_options, &p->options);
+       }
+     }
diff -Nru cups-2.4.2/debian/patches/0018-dont-override-color-settings-from-print-dialoag.patch cups-2.4.2/debian/patches/0018-dont-override-color-settings-from-print-dialoag.patch
--- cups-2.4.2/debian/patches/0018-dont-override-color-settings-from-print-dialoag.patch	1970-01-01 01:00:00.000000000 +0100
+++ cups-2.4.2/debian/patches/0018-dont-override-color-settings-from-print-dialoag.patch	2023-12-01 20:35:27.000000000 +0100
@@ -0,0 +1,78 @@
+From: Thorsten Alteholz <debian@alteholz.de>
+Date: Sat, 2 Dec 2023 00:01:23 +0100
+Subject: dont override color settings from print dialoag
+
+---
+ cups/ppd-cache.c | 39 +++++++++++++++++++++++++++++++++++----
+ scheduler/ipp.c  |  3 +++
+ 2 files changed, 38 insertions(+), 4 deletions(-)
+
+diff --git a/cups/ppd-cache.c b/cups/ppd-cache.c
+index 8861813..f72d834 100644
+--- a/cups/ppd-cache.c
++++ b/cups/ppd-cache.c
+@@ -259,15 +259,46 @@ _cupsConvertOptions(
+ 
+   color_attr_name = print_color_mode_sup ? "print-color-mode" : "output-mode";
+ 
+-  if ((keyword = cupsGetOption("print-color-mode", num_options, options)) == NULL)
++ /*
++  * If we use PPD with standardized PPD option for color support - ColorModel,
++  * prefer it to don't break color/grayscale support for PPDs, either classic
++  * or the ones generated from IPP Get-Printer-Attributes response.
++  */
++
++  if ((keyword = cupsGetOption("ColorModel", num_options, options)) == NULL)
+   {
++   /*
++    * No ColorModel in options...
++    */
++
+     if ((choice = ppdFindMarkedChoice(ppd, "ColorModel")) != NULL)
+     {
+-      if (!_cups_strcasecmp(choice->choice, "Gray"))
+-	keyword = "monochrome";
++     /*
++      * ColorModel is taken from PPD as its default option.
++      */
++
++      if (!strcmp(choice->choice, "Gray") || !strcmp(choice->choice, "FastGray") || !strcmp(choice->choice, "DeviceGray"))
++        keyword = "monochrome";
+       else
+-	keyword = "color";
++        keyword = "color";
+     }
++    else
++     /*
++      * print-color-mode is a default option since 2.4.1, use it as a fallback if there is no
++      * ColorModel in options or PPD...
++      */
++      keyword = cupsGetOption("print-color-mode", num_options, options);
++  }
++  else
++  {
++   /*
++    * ColorModel found in options...
++    */
++
++    if (!strcmp(keyword, "Gray") || !strcmp(keyword, "FastGray") || !strcmp(keyword, "DeviceGray"))
++      keyword = "monochrome";
++    else
++      keyword = "color";
+   }
+ 
+   if (keyword && !strcmp(keyword, "monochrome"))
+diff --git a/scheduler/ipp.c b/scheduler/ipp.c
+index 14cadb0..d5b0f14 100644
+--- a/scheduler/ipp.c
++++ b/scheduler/ipp.c
+@@ -2937,6 +2937,9 @@ apply_printer_defaults(
+       if (!strcmp(option->name, "print-quality") && ippFindAttribute(job->attrs, "cupsPrintQuality", IPP_TAG_NAME))
+         continue;                     /* Don't override cupsPrintQuality */
+ 
++      if (!strcmp(option->name, "print-color-mode") && ippFindAttribute(job->attrs, "ColorModel", IPP_TAG_NAME))
++        continue;                     /* Don't override ColorModel */
++
+       cupsdLogJob(job, CUPSD_LOG_DEBUG, "Adding default %s=%s", option->name, option->value);
+ 
+       num_options = cupsAddOption(option->name, option->value, num_options, &options);
diff -Nru cups-2.4.2/debian/patches/series cups-2.4.2/debian/patches/series
--- cups-2.4.2/debian/patches/series	2023-10-05 16:35:27.000000000 +0200
+++ cups-2.4.2/debian/patches/series	2023-12-01 20:35:27.000000000 +0100
@@ -14,3 +14,5 @@
 0014-CVE-2023-34241.patch
 0015-CVE-2023-4504.patch
 0016-CVE-2023-32360.patch
+0017-check-colormodel-also-for-CMYK.patch
+0018-dont-override-color-settings-from-print-dialoag.patch

Reply to: