From: Michael R Sweet Date: Tue, 13 Mar 2018 01:47:00 +0000 (-0400) Subject: Fix printing to some IPP Everywhere printers (Issue #5238) X-Git-Tag: v2.3b4~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e6062e8e9cda552e90482d1390ab95ce81650caa;p=thirdparty%2Fcups.git Fix printing to some IPP Everywhere printers (Issue #5238) --- diff --git a/CHANGES.md b/CHANGES.md index c6a4bd8886..8405eaac7f 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -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) diff --git a/cups/ppd-cache.c b/cups/ppd-cache.c index dfa0afbf93..efc103b2fe 100644 --- a/cups/ppd-cache.c +++ b/cups/ppd-cache.c @@ -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)