]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Fix printing to some IPP Everywhere printers (Issue #5238)
authorMichael R Sweet <michael.r.sweet@gmail.com>
Tue, 13 Mar 2018 01:47:00 +0000 (21:47 -0400)
committerMichael R Sweet <michael.r.sweet@gmail.com>
Tue, 13 Mar 2018 01:47:00 +0000 (21:47 -0400)
CHANGES.md
cups/ppd-cache.c

index c6a4bd88868fc898c5fa0092dba0fbc995f54cb9..8405eaac7f28e97a152bb5db47079c0ca88a31bd 100644 (file)
@@ -6,6 +6,7 @@ Changes in CUPS v2.3rc1
 
 - Kerberized printing to another CUPS server did not work correctly
   (Issue #5233)
+- Fixed printing to some IPP Everywhere printers (Issue #5238)
 - Fixed installation of filters (Issue #5247)
 - The scheduler now supports using temporary print queues for older IPP/1.1
   print queues like those shared by CUPS 1.3 and earlier (Issue #5241)
index dfa0afbf933f2cc03dc43ed6b46b072d419affcd..efc103b2fe46f210250cfe4672c06084fb578b7b 100644 (file)
@@ -1,9 +1,10 @@
 /*
  * PPD cache implementation for CUPS.
  *
- * Copyright 2010-2017 by Apple Inc.
+ * Copyright © 2010-2018 by Apple Inc.
  *
- * Licensed under Apache License v2.0.  See the file "LICENSE" for more information.
+ * Licensed under Apache License v2.0.  See the file "LICENSE" for more
+ * information.
  */
 
 /*
@@ -3178,24 +3179,18 @@ _ppdCreateFromIPP(char   *buffer,       /* I - Filename buffer */
   {
     is_apple = ippContainsString(attr, "image/urf");
     is_pdf   = ippContainsString(attr, "application/pdf");
-    is_pwg   = ippContainsString(attr, "image/pwg-raster");
-
-    for (i = 0, count = ippGetCount(attr); i < count; i ++)
-    {
-      const char *format = ippGetString(attr, i, NULL);
-                                       /* PDL */
-
-     /*
-      * Write cupsFilter2 lines for supported formats...
-      */
-
-      if (!_cups_strcasecmp(format, "application/pdf"))
-        cupsFilePuts(fp, "*cupsFilter2: \"application/vnd.cups-pdf application/pdf 10 -\"\n");
-      else if (!_cups_strcasecmp(format, "image/jpeg") || !_cups_strcasecmp(format, "image/png"))
-        cupsFilePrintf(fp, "*cupsFilter2: \"%s %s 0 -\"\n", format, format);
-      else if (!_cups_strcasecmp(format, "image/pwg-raster") || !_cups_strcasecmp(format, "image/urf"))
-        cupsFilePrintf(fp, "*cupsFilter2: \"%s %s 100 -\"\n", format, format);
-    }
+    is_pwg   = ippContainsString(attr, "image/pwg-raster") && !is_apple;
+
+    if (ippContainsString(attr, "image/jpeg"))
+      cupsFilePuts(fp, "*cupsFilter2: \"image/jpeg image/jpeg 0 -\"\n");
+    if (ippContainsString(attr, "image/png"))
+      cupsFilePuts(fp, "*cupsFilter2: \"image/png image/png 0 -\"\n");
+    if (is_pdf)
+      cupsFilePuts(fp, "*cupsFilter2: \"application/vnd.cups-pdf application/pdf 10 -\"\n");
+    if (is_apple)
+      cupsFilePuts(fp, "*cupsFilter2: \"image/urf image/urf 100 -\"\n");
+    if (is_pwg)
+      cupsFilePuts(fp, "*cupsFilter2: \"image/pwg-raster image/pwg-raster 100 -\"\n");
   }
 
   if (!is_apple && !is_pdf && !is_pwg)