]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
cups/ppd-cache.c: synthetize grayscale if only color is defined 1/head
authorZdenek Dohnal <zdohnal@redhat.com>
Mon, 26 Oct 2020 09:08:58 +0000 (10:08 +0100)
committerZdenek Dohnal <zdohnal@redhat.com>
Mon, 26 Oct 2020 09:08:58 +0000 (10:08 +0100)
cups/ppd-cache.c

index 5965e382bb80b2108b7c9ebbf56451daa4af53fb..a680ca76d7b32e4ae523b110cfeb56e73f0c7f1b 100644 (file)
@@ -3790,6 +3790,9 @@ _ppdCreateFromIPP(char   *buffer, /* I - Filename buffer */
        PRINTF_COLOROPTION("RGB", _("Color"), CUPS_CSPACE_SRGB, 8)
 
        default_color = "RGB";
+
+       if (ippGetCount(attr) == 1 || !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"))
       {