From 0b404630b8ea643f8836ced2d52c6fdcc40deeb5 Mon Sep 17 00:00:00 2001 From: Zdenek Dohnal Date: Thu, 2 Mar 2023 17:25:29 +0100 Subject: [PATCH] check for cmyk when figuring out default options --- ...rs.c-Check-for-CMYK-as-well-fixes-42.patch | 33 +++++++++++++++++++ cups.spec | 4 +++ 2 files changed, 37 insertions(+) create mode 100644 0001-scheduler-printers.c-Check-for-CMYK-as-well-fixes-42.patch diff --git a/0001-scheduler-printers.c-Check-for-CMYK-as-well-fixes-42.patch b/0001-scheduler-printers.c-Check-for-CMYK-as-well-fixes-42.patch new file mode 100644 index 0000000..6c9497d --- /dev/null +++ b/0001-scheduler-printers.c-Check-for-CMYK-as-well-fixes-42.patch @@ -0,0 +1,33 @@ +From ca866d8a9de27e05f7fc04ad6a2a586089341c53 Mon Sep 17 00:00:00 2001 +From: Zdenek Dohnal +Date: Tue, 18 Oct 2022 14:12:13 +0200 +Subject: [PATCH] scheduler/printers.c: Check for CMYK as well (fixes #421) + +In `load_ppd()` we would set the `print-color-mode` to `monochrome` only if +the device supported color printing and the default PPD choice for +ColorModel was RGB - this broke settings for color printing for models, +which use `CMYK` for ColorModel. + +With this patch we check for CMYK as well. + +CUPS 3.0- +--- + scheduler/printers.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/scheduler/printers.c b/scheduler/printers.c +index 3ca91fd45..757f265ce 100644 +--- a/scheduler/printers.c ++++ b/scheduler/printers.c +@@ -4547,7 +4547,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); + } + } +-- +2.39.2 + diff --git a/cups.spec b/cups.spec index fb1bd32..1724a64 100644 --- a/cups.spec +++ b/cups.spec @@ -75,6 +75,7 @@ Patch1002: cups-resolve-local.patch Patch1003: cups-ippeveprinter-typo.patch Patch1004: 0001-Don-t-override-color-settings-from-print-dialog.patch Patch1005: 0001-scheduler-ipp.c-Convert-incoming-ColorModel-attribut.patch +Patch1006: 0001-scheduler-printers.c-Check-for-CMYK-as-well-fixes-42.patch ##### Patches removed because IMHO they aren't no longer needed ##### but still I'll leave them in git in case their removal @@ -295,6 +296,8 @@ to CUPS daemon. This solution will substitute printer drivers and raw queues in %patch1004 -p1 -b .no_color_override # https://github.com/OpenPrinting/cups/pull/451 %patch1005 -p1 -b .save-color-settings +# https://github.com/OpenPrinting/cups/pull/500 +%patch1006 -p1 -b .check-for-cmyk %if %{lspp} @@ -705,6 +708,7 @@ rm -f %{cups_serverbin}/backend/smb - fix loading ippeveps in ippeveprinter if only the command name is provided - don't override color settings from print dialog - save the color settings between restarts +- check for cmyk when figuring out default options * Mon Feb 20 2023 Zdenek Dohnal - 1:2.4.2-9 - move /etc/cups into cups-filesystem, since cups-browsed needs it