From: Till Kamppeter Date: Wed, 15 Feb 2023 21:01:05 +0000 (+0100) Subject: In auto-generated PPDs do not set RGB default on mono printers X-Git-Tag: v2.4.3~47 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ebf3bb82593e5f49093ed7b9e52452333240d225;p=thirdparty%2Fcups.git 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. --- diff --git a/cups/ppd-cache.c b/cups/ppd-cache.c index 3c53f510dc..2489ee313c 100644 --- a/cups/ppd-cache.c +++ b/cups/ppd-cache.c @@ -4129,7 +4129,8 @@ _ppdCreateFromIPP2( int wrote_color = 0; const char *default_color = NULL; /* Default */ - 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";