Skip to content

Commit de0747e

Browse files
committed
libcupsfilters: Made driverless PPD generator more reliable for print or fax PPD
(cherry picked from commit d7b22d7)
1 parent 67c2128 commit de0747e

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ NEWS - OpenPrinting CUPS Filters v1.28.7 - 2021-01-07
33

44
CHANGES IN V1.28.8
55

6+
- libcupsfilters: Made check whether the driverless PPD to
7+
generate should be a fax out PPD more reliable (Issue #343).
68
- foomatic-rip: Options in the 5th command line argument of
79
the CUPS filter command line are separated only by white
810
space and not by comma, also make sure that an option "none"

cupsfilters/ppdgenerator.c

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1678,9 +1678,18 @@ ppdCreateFromIPP2(char *buffer, /* I - Filename buffer */
16781678
cupsFilePuts(fp, "*PCFileName: \"drvless.ppd\"\n");
16791679

16801680
if ((attr = ippFindAttribute(response, "ipp-features-supported",
1681-
IPP_TAG_KEYWORD))!= NULL &&
1681+
IPP_TAG_KEYWORD)) != NULL &&
16821682
ippContainsString(attr, "faxout"))
1683-
is_fax = 1;
1683+
{
1684+
attr = ippFindAttribute(response, "printer-uri-supported",
1685+
IPP_TAG_URI);
1686+
if (attr)
1687+
{
1688+
ippAttributeString(attr, buf, sizeof(buf));
1689+
if (strcasestr(buf, "faxout"))
1690+
is_fax = 1;
1691+
}
1692+
}
16841693

16851694
if ((attr = ippFindAttribute(response, "printer-make-and-model",
16861695
IPP_TAG_TEXT)) != NULL)
@@ -4220,12 +4229,13 @@ ppdCreateFromIPP2(char *buffer, /* I - Filename buffer */
42204229
free(max_res);
42214230

42224231
snprintf(ppdgenerator_msg, sizeof(ppdgenerator_msg),
4223-
"%s PPD generated.",
4224-
(is_pdf ? "PDF" :
4232+
"%s %sPPD generated.",
4233+
(is_apple ? "Apple Raster" :
42254234
(is_pwg ? "PWG Raster" :
4226-
(is_apple ? "Apple Raster" :
4235+
(is_pdf ? "PDF" :
42274236
(is_pclm ? "PCLm" :
4228-
"Legacy IPP printer")))));
4237+
"Legacy IPP printer")))),
4238+
(is_fax ? "Fax " : ""));
42294239

42304240
cupsFileClose(fp);
42314241
if (printer_opt_strings_catalog)

0 commit comments

Comments
 (0)