libppd: Fix duplicate ColorModel entries in generated PPD files
@@ -3818,6 +3818,8 @@ ppdCreateFromIPPCUPS(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);
@@ -3865,7 +3867,9 @@ ppdCreateFromIPPCUPS(char *buffer, /* I - Filename buffer */
default_color = "RGB";
- if (ippGetCount(attr) == 1 || (!ippContainsString(attr, "sgray_8") && !ippContainsString(attr, "black_1") && !ippContainsString(attr, "black_8")))
+ // 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") && !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"))
