]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
ppd-cache.c: Check for PWG attribute as well 890/head
authorZdenek Dohnal <zdohnal@redhat.com>
Wed, 14 Feb 2024 14:38:01 +0000 (15:38 +0100)
committerZdenek Dohnal <zdohnal@redhat.com>
Wed, 14 Feb 2024 14:38:49 +0000 (15:38 +0100)
If the device reports image/pwg-raster and we are about to use it, check
for pwg-raster-document-resolution-supported too.

cups/ppd-cache.c

index 737e872912137cf02d31f61b7bd6d73a7555e0c2..ec0de56a72156d9722e2dfbd4ec9d50c362b1151 100644 (file)
@@ -3437,7 +3437,9 @@ _ppdCreateFromIPP2(
   {
     is_apple = ippContainsString(attr, "image/urf") && (ippFindAttribute(supported, "urf-supported", IPP_TAG_KEYWORD) != NULL);
     is_pdf   = ippContainsString(attr, "application/pdf");
-    is_pwg   = ippContainsString(attr, "image/pwg-raster") && !is_apple;
+    is_pwg   = ippContainsString(attr, "image/pwg-raster") && !is_apple &&
+              (ippFindAttribute(supported, "pwg-raster-document-resolution-supported", IPP_TAG_KEYWORD) != NULL) &&
+              (ippFindAttribute(supported, "pwg-raster-document-type-supported", IPP_TAG_KEYWORD) != NULL);
 
     if (ippContainsString(attr, "image/jpeg"))
       cupsFilePuts(fp, "*cupsFilter2: \"image/jpeg image/jpeg 0 -\"\n");