]> git.ipfire.org Git - thirdparty/cups-filters.git/commitdiff
libcupsfilters: Let ghostscript() do raster PDF in gray on bw jobs
authorTill Kamppeter <till.kamppeter@gmail.com>
Tue, 12 Apr 2022 07:44:31 +0000 (09:44 +0200)
committerTill Kamppeter <till.kamppeter@gmail.com>
Tue, 12 Apr 2022 07:44:31 +0000 (09:44 +0200)
The ghostscript() filter function did PDF Image (raster PDF) output in
color if the printer is a color printer, in gray only if the printer
is monochrome. Monochrome jobs were therefore printed in color on
color printers. This commit makes grayscale output also used if the
job is monochrome.

cupsfilters/ghostscript.c

index c6cddc159c06f0e5c13633cd4394a2463294ace0..baed09317403bd102730114be766faa1553169d8 100644 (file)
@@ -1258,18 +1258,18 @@ cfFilterGhostscript(int inputfd,            /* I - File descriptor input
            (!strcasecmp(attr->value, "true") ||
             !strcasecmp(attr->value, "on") ||
             !strcasecmp(attr->value, "yes")))
-          /* Color PCL XL printer, according to PPD */
+          /* Color printer, according to PPD */
          n = 1;
       } else if (printer_attrs) {
        if (((ipp_attr =
              ippFindAttribute(printer_attrs,
                               "color-supported", IPP_TAG_ZERO)) != NULL &&
             ippGetBoolean(ipp_attr, 0))) {
-         /* Color PCL XL printer, according to printer attributes */
+         /* Color printer, according to printer attributes */
          n = 1;
        }
       }
-      if (n == 1)
+      if (n == 1 && h.cupsNumColors > 1)
        cupsArrayAdd(gs_args, strdup("-sDEVICE=pdfimage24"));
       else
        cupsArrayAdd(gs_args, strdup("-sDEVICE=pdfimage8"));