check for cmyk when figuring out default options

This commit is contained in:
Zdenek Dohnal 2023-03-02 17:25:29 +01:00
parent 3b474fa081
commit 0b404630b8
2 changed files with 37 additions and 0 deletions

View File

@ -0,0 +1,33 @@
From ca866d8a9de27e05f7fc04ad6a2a586089341c53 Mon Sep 17 00:00:00 2001
From: Zdenek Dohnal <zdohnal@redhat.com>
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

View File

@ -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 <zdohnal@redhat.com> - 1:2.4.2-9
- move /etc/cups into cups-filesystem, since cups-browsed needs it