]> git.ipfire.org Git - thirdparty/cups-filters.git/commitdiff
libcupsfilters: In PPD generator create only one *cupsFilter2: line for raster
authorTill Kamppeter <till.kamppeter@gmail.com>
Wed, 25 Jan 2023 00:44:32 +0000 (21:44 -0300)
committerTill Kamppeter <till.kamppeter@gmail.com>
Wed, 25 Jan 2023 00:44:32 +0000 (21:44 -0300)
If a printer supports more than one raster format (Apple Raster, PWG
Raster, PCLm), create only one "*cupsFilter2: ..." line for raster,
for the most desirable/reliable raster format.

Most preferred is Apple Raster, then PWG Raster, and after that PCLm

See

    https://github.com/OpenPrinting/cups-filters/issues/498

Here a printer works correctly with Apple Raster but does not print
the page in its original size with PWG Raster.

cupsfilters/ppdgenerator.c

index dad6dbcf8bd7380f0edf95a700049c382e0b89b8..32f94c625eff36f7238c638a933bd7d6207319e3 100644 (file)
@@ -2023,7 +2023,7 @@ ppdCreateFromIPP2(char         *buffer,          /* I - Filename buffer */
     }
   }
 #endif
-  if (cupsArrayFind(pdl_list, "image/pwg-raster")) {
+  if (!is_apple && cupsArrayFind(pdl_list, "image/pwg-raster")) {
     if ((attr = ippFindAttribute(response,
                                 "pwg-raster-document-resolution-supported",
                                 IPP_TAG_RESOLUTION)) != NULL) {
@@ -2039,7 +2039,7 @@ ppdCreateFromIPP2(char         *buffer,          /* I - Filename buffer */
     }
   }
 #ifdef QPDF_HAVE_PCLM
-  if (cupsArrayFind(pdl_list, "application/PCLm")) {
+  if (!is_apple && !is_pwg && cupsArrayFind(pdl_list, "application/PCLm")) {
     if ((attr = ippFindAttribute(response, "pclm-source-resolution-supported",
                                 IPP_TAG_RESOLUTION)) != NULL) {
       if ((defattr = ippFindAttribute(response,