From: Michael R Sweet Date: Thu, 3 Dec 2020 01:02:59 +0000 (-0500) Subject: Fix duplicate ColorModel entries for AirPrint printers (Issue #59) X-Git-Tag: v2.3.3op2~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c9e871e09f0f37b9b1757a2661f5957c273dc2a2;p=thirdparty%2Fcups.git Fix duplicate ColorModel entries for AirPrint printers (Issue #59) --- diff --git a/CHANGES-OPENPRINTING.md b/CHANGES-OPENPRINTING.md index fc249f69f8..6bf41a449b 100644 --- a/CHANGES-OPENPRINTING.md +++ b/CHANGES-OPENPRINTING.md @@ -5,6 +5,7 @@ Changes in CUPS v2.3.3op2 ------------------------- - Clarified the documentation for the "Listen" directive (Issue #53) +- Fixed duplicate ColorModel entries for AirPrint printers (Issue 59) Changes in CUPS v2.3.3op1 diff --git a/cups/ppd-cache.c b/cups/ppd-cache.c index e27b05bab4..bdc6bb0ed4 100644 --- a/cups/ppd-cache.c +++ b/cups/ppd-cache.c @@ -3751,6 +3751,8 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */ int wrote_color = 0; const char *default_color = NULL; /* Default */ + cupsFilePrintf(fp, "*%% ColorModel from %s\n", ippGetName(attr)); + for (i = 0, count = ippGetCount(attr); i < count; i ++) { keyword = ippGetString(attr, i, NULL); @@ -3800,7 +3802,7 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */ // Apparently some printers only advertise color support, so make sure // we also do grayscale for these printers... - if (!ippContainsString(attr, "sgray_8") && !ippContainsString(attr, "black_1") && !ippContainsString(attr, "black_8")) + if (!ippContainsString(attr, "sgray_8") && !ippContainsString(attr, "black_1") && !ippContainsString(attr, "black_8") && !ippContainsString(attr, "W8") && !ippContainsString(attr, "W8-16")) PRINTF_COLOROPTION("Gray", _("GrayScale"), CUPS_CSPACE_SW, 8) } else if (!strcasecmp(keyword, "adobe-rgb_16") || !strcmp(keyword, "ADOBERGB48") || !strcmp(keyword, "ADOBERGB24-48"))