-CHANGES - 2.2.5 - 2017-08-28
+CHANGES - 2.2.5 - 2017-08-29
============================
CHANGES IN CUPS V2.2.5
- Updated the cups-files.conf and cupsd.conf file documentation for missing
directives (Issue #5084)
- Fixed an Avahi-related crash bug in the scheduler (Issue #5085, Issue #5086)
+- Fixed the interactions between the "print-quality" and "cupsPrintQuality"
+ options (Issue #5090)
- The IPP Everywhere PPD generator now sorts the supported resolutions before
choosing them for draft, normal, and best quality modes (Issue #5091)
- Fixed the localization unit test on Linux (Issue #5097)
/*
* Option marking routines for CUPS.
*
- * Copyright 2007-2015 by Apple Inc.
+ * Copyright 2007-2017 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
*/
for (i = num_options, optptr = options; i > 0; i --, optptr ++)
+ {
if (!_cups_strcasecmp(optptr->name, "media") ||
!_cups_strcasecmp(optptr->name, "output-bin") ||
!_cups_strcasecmp(optptr->name, "output-mode") ||
ppd_mark_option(ppd, "MirrorPrint", optptr->value);
else
ppd_mark_option(ppd, optptr->name, optptr->value);
+ }
+
+ if (print_quality)
+ {
+ int pq = atoi(print_quality); /* print-quaity value */
+
+ if (pq == IPP_QUALITY_DRAFT)
+ ppd_mark_option(ppd, "cupsPrintQuality", "Draft");
+ else if (pq == IPP_QUALITY_HIGH)
+ ppd_mark_option(ppd, "cupsPrintQuality", "High");
+ else
+ ppd_mark_option(ppd, "cupsPrintQuality", "Normal");
+ }
ppd_debug_marked(ppd, "After...");
i --, option ++)
if (!ippFindAttribute(job->attrs, option->name, IPP_TAG_ZERO))
{
- num_options = cupsAddOption(option->name, option->value, num_options,
- &options);
+ if (!strcmp(option->name, "print-quality") && ippFindAttribute(job->attrs, "cupsPrintQuality", IPP_TAG_NAME))
+ continue; /* Don't override cupsPrintQuality */
+
+ num_options = cupsAddOption(option->name, option->value, num_options, &options);
}
/*
/*
* Job management routines for the CUPS scheduler.
*
- * Copyright 2007-2016 by Apple Inc.
+ * Copyright 2007-2017 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
pwgppds = NULL;
if (pc &&
- !ippFindAttribute(job->attrs,
- "com.apple.print.DocumentTicket.PMSpoolFormat",
- IPP_TAG_ZERO) &&
+ !ippFindAttribute(job->attrs, "com.apple.print.DocumentTicket.PMSpoolFormat", IPP_TAG_ZERO) &&
!ippFindAttribute(job->attrs, "APPrinterPreset", IPP_TAG_ZERO) &&
- (ippFindAttribute(job->attrs, "print-color-mode", IPP_TAG_ZERO) ||
- ippFindAttribute(job->attrs, "print-quality", IPP_TAG_ZERO)))
+ (ippFindAttribute(job->attrs, "print-color-mode", IPP_TAG_ZERO) || ippFindAttribute(job->attrs, "print-quality", IPP_TAG_ZERO) || ippFindAttribute(job->attrs, "cupsPrintQuality", IPP_TAG_ZERO)))
{
/*
* Map print-color-mode and print-quality to a preset...
else
print_color_mode = _PWG_PRINT_COLOR_MODE_COLOR;
- if ((attr = ippFindAttribute(job->attrs, "print-quality",
- IPP_TAG_ENUM)) != NULL &&
- attr->values[0].integer >= IPP_QUALITY_DRAFT &&
- attr->values[0].integer <= IPP_QUALITY_HIGH)
- print_quality = attr->values[0].integer - IPP_QUALITY_DRAFT;
+ if ((attr = ippFindAttribute(job->attrs, "print-quality", IPP_TAG_ENUM)) != NULL)
+ {
+ ipp_quality_t pq = (ipp_quality_t)ippGetInteger(attr, 0);
+
+ if (pq >= IPP_QUALITY_DRAFT && pq <= IPP_QUALITY_HIGH)
+ print_quality = attr->values[0].integer - IPP_QUALITY_DRAFT;
+ else
+ print_quality = _PWG_PRINT_QUALITY_NORMAL;
+ }
+ else if ((attr = ippFindAttribute(job->attrs, "cupsPrintQuality", IPP_TAG_NAME)) != NULL)
+ {
+ const char *pq = ippGetString(attr, 0, NULL);
+
+ if (!_cups_strcasecmp(pq, "draft"))
+ print_quality = _PWG_PRINT_QUALITY_DRAFT;
+ else if (!_cups_strcasecmp(pq, "high"))
+ print_quality = _PWG_PRINT_QUALITY_HIGH;
+ else
+ print_quality = _PWG_PRINT_QUALITY_NORMAL;
+ }
else
+ {
print_quality = _PWG_PRINT_QUALITY_NORMAL;
+ }
if (pc->num_presets[print_color_mode][print_quality] == 0)
{
if (pc)
{
+ if ((attr = ippFindAttribute(job->attrs, "print-quality", IPP_TAG_ENUM)) != NULL)
+ {
+ int pq = ippGetInteger(attr, 0);
+ static const char * const pqs[] = { "Draft", "Normal", "High" };
+
+ if (pq >= IPP_QUALITY_DRAFT && pq <= IPP_QUALITY_HIGH)
+ num_pwgppds = cupsAddOption("cupsPrintQuality", pqs[pq - IPP_QUALITY_DRAFT], num_pwgppds, &pwgppds);
+ }
+
if (!ippFindAttribute(job->attrs, "InputSlot", IPP_TAG_ZERO) &&
!ippFindAttribute(job->attrs, "HPPaperSource", IPP_TAG_ZERO))
{
cupsArrayAdd(CommonDefaults, _cupsStrAlloc("document-format-default"));
cupsArrayAdd(CommonDefaults, _cupsStrAlloc("finishings-default"));
cupsArrayAdd(CommonDefaults, _cupsStrAlloc("job-account-id-default"));
- cupsArrayAdd(CommonDefaults,
- _cupsStrAlloc("job-accounting-user-id-default"));
+ cupsArrayAdd(CommonDefaults, _cupsStrAlloc("job-accounting-user-id-default"));
cupsArrayAdd(CommonDefaults, _cupsStrAlloc("job-cancel-after-default"));
cupsArrayAdd(CommonDefaults, _cupsStrAlloc("job-hold-until-default"));
cupsArrayAdd(CommonDefaults, _cupsStrAlloc("job-priority-default"));
cupsArrayAdd(CommonDefaults, _cupsStrAlloc("job-sheets-default"));
cupsArrayAdd(CommonDefaults, _cupsStrAlloc("media-col-default"));
+ cupsArrayAdd(CommonDefaults, _cupsStrAlloc("notify-lease-duration-default"));
+ cupsArrayAdd(CommonDefaults, _cupsStrAlloc("notify-events-default"));
cupsArrayAdd(CommonDefaults, _cupsStrAlloc("number-up-default"));
- cupsArrayAdd(CommonDefaults,
- _cupsStrAlloc("orientation-requested-default"));
+ cupsArrayAdd(CommonDefaults, _cupsStrAlloc("orientation-requested-default"));
+ cupsArrayAdd(CommonDefaults, _cupsStrAlloc("print-quality-default"));
}
/*