1 From ebf3bb82593e5f49093ed7b9e52452333240d225 Mon Sep 17 00:00:00 2001
2 From: Till Kamppeter <till.kamppeter@gmail.com>
3 Date: Wed, 15 Feb 2023 22:01:05 +0100
4 Subject: [PATCH] In auto-generated PPDs do not set RGB default on mono
7 When a PPD for a driverless printer is generated by the
8 _ppdCreateFromIPP2() function and the get-printer-attributes IPP
9 response gives "print-color-mode-default=auto" the PPD's default
10 setting for "ColorModel" is always "RGB", even on monochrome printers,
11 which makes printing fail on most devices.
13 Now we ignore the "print-color-mode-default" if set to "auto" and
14 proceed as if no default was given, finding the default by selecting
15 the most desirable of the existing "ColorModel" choices.
17 cups/ppd-cache.c | 3 ++-
18 1 file changed, 2 insertions(+), 1 deletion(-)
20 diff --git a/cups/ppd-cache.c b/cups/ppd-cache.c
21 index 3c53f510d..2489ee313 100644
22 --- a/cups/ppd-cache.c
23 +++ b/cups/ppd-cache.c
24 @@ -4129,7 +4129,8 @@ _ppdCreateFromIPP2(
26 const char *default_color = NULL; /* Default */
28 - if ((keyword = ippGetString(defattr, 0, NULL)) != NULL)
29 + if ((keyword = ippGetString(defattr, 0, NULL)) != NULL &&
30 + strcmp(keyword, "auto"))
32 if (!strcmp(keyword, "bi-level"))
33 default_color = "FastGray";