From 3beb10c19aa4d525d4c477918fcee7210168d799 Mon Sep 17 00:00:00 2001 From: Zdenek Dohnal Date: Mon, 2 Nov 2020 13:13:09 +0100 Subject: [PATCH] backport cups-prioritize-print-color-mode.patch from upstream --- cups-prioritize-print-color-mode.patch | 23 ++++++++++++----------- cups.spec | 1 + 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/cups-prioritize-print-color-mode.patch b/cups-prioritize-print-color-mode.patch index feb7119..37a1e5a 100644 --- a/cups-prioritize-print-color-mode.patch +++ b/cups-prioritize-print-color-mode.patch @@ -1,15 +1,16 @@ diff --git a/cups/ppd-cache.c b/cups/ppd-cache.c -index 5965e38..94a125a 100644 +index 167e1df..6c05735 100644 --- a/cups/ppd-cache.c +++ b/cups/ppd-cache.c -@@ -3735,8 +3735,8 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */ - */ +@@ -3790,6 +3790,11 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */ + PRINTF_COLOROPTION("RGB", _("Color"), CUPS_CSPACE_SRGB, 8) - if ((attr = ippFindAttribute(response, "urf-supported", IPP_TAG_KEYWORD)) == NULL) -- if ((attr = ippFindAttribute(response, "pwg-raster-document-type-supported", IPP_TAG_KEYWORD)) == NULL) -- if ((attr = ippFindAttribute(response, "print-color-mode-supported", IPP_TAG_KEYWORD)) == NULL) -+ if ((attr = ippFindAttribute(response, "print-color-mode-supported", IPP_TAG_KEYWORD)) == NULL) -+ if ((attr = ippFindAttribute(response, "pwg-raster-document-type-supported", IPP_TAG_KEYWORD)) == NULL) - attr = ippFindAttribute(response, "output-mode-supported", IPP_TAG_KEYWORD); - - if (attr) + default_color = "RGB"; ++ ++ // 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")) ++ PRINTF_COLOROPTION("Gray", _("GrayScale"), CUPS_CSPACE_SW, 8) + } + else if (!strcasecmp(keyword, "adobe-rgb_16") || !strcmp(keyword, "ADOBERGB48") || !strcmp(keyword, "ADOBERGB24-48")) + { diff --git a/cups.spec b/cups.spec index d1f1753..b03e622 100644 --- a/cups.spec +++ b/cups.spec @@ -767,6 +767,7 @@ rm -f %{cups_serverbin}/backend/smb %changelog * Mon Nov 02 2020 Zdenek Dohnal - 1:2.3.3-16 - backport cups-ipptool-mdns-uri.patch from upstream +- backport cups-prioritize-print-color-mode.patch from upstream * Thu Sep 03 2020 Zdenek Dohnal - 1:2.3.3-14 - revert previous commit - resolved doesn't work with avahi due missing link