-
Notifications
You must be signed in to change notification settings - Fork 0
/
0001-auto-generated-pppds-do-not-set-rgb-default-on-mono-printers.patch
42 lines (35 loc) · 1.64 KB
/
0001-auto-generated-pppds-do-not-set-rgb-default-on-mono-printers.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
From 9799398713b941557642d0b2bdbef360837ece0c Mon Sep 17 00:00:00 2001
From: Till Kamppeter <[email protected]>
Date: Wed, 15 Feb 2023 22:29:38 +0100
Subject: [PATCH] In auto-generated PPDs do not set RGB default on mono
printers
When a PPD for a driverless printer is generated by the
_ppdCreateFromIPP2() function and the get-printer-attributes IPP
response gives "print-color-mode-default=auto" the PPD's default
setting for "ColorModel" is always "RGB", even on monochrome printers,
which makes printing fail on most devices.
Now we ignore the "print-color-mode-default" if set to "auto" and
proceed as if no default was given, finding the default by selecting
the most desirable of the existing "ColorModel" choices.
Discovered via
https://github.com/OpenPrinting/cups/issues/614
The bug was originally reported against ipp-usb as the reporter's
printer was connected via IPP-over-USB, but actually the PPD
generators are at fault, and here not only the one in CUPS but also
the one in cups-filters 1.x and libppd 2.x.
---
cupsfilters/ppdgenerator.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/cupsfilters/ppdgenerator.c b/cupsfilters/ppdgenerator.c
index 32f94c625..0d4dd7097 100644
--- a/cupsfilters/ppdgenerator.c
+++ b/cupsfilters/ppdgenerator.c
@@ -2801,7 +2801,8 @@ ppdCreateFromIPP2(char *buffer, /* I - Filename buffer */
have_bi_level = 0,
have_mono = 0;
- if ((keyword = ippGetString(defattr, 0, NULL)) != NULL)
+ if ((keyword = ippGetString(defattr, 0, NULL)) != NULL &&
+ strcmp(keyword, "auto"))
{
if (!strcmp(keyword, "bi-level"))
default_color = "FastGray";