]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Fix duplicate ColorModel entries for AirPrint printers (Issue #59)
authorMichael R Sweet <msweet@msweet.org>
Thu, 3 Dec 2020 01:02:59 +0000 (20:02 -0500)
committerMichael R Sweet <msweet@msweet.org>
Thu, 3 Dec 2020 01:02:59 +0000 (20:02 -0500)
CHANGES-OPENPRINTING.md
cups/ppd-cache.c

index fc249f69f85434126ac7c9d7070e0202f65e23d3..6bf41a449b2a0871a324b5aa6a2732e3b9079821 100644 (file)
@@ -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
index e27b05bab4f349f82d32348246a7d0ad2e69d40f..bdc6bb0ed435c6bf37a8cde13cac50cfbc54729c 100644 (file)
@@ -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"))