-CHANGES.txt - 2.2.2 - 2016-11-07
+CHANGES.txt - 2.2.2 - 2016-11-08
--------------------------------
CHANGES IN CUPS V2.2.2
- Fixed some issues with the Zebra ZPL printer driver (Issue #4898)
- Fixed some issues with IPP Everywhere printer support (Issue #4893,
- Issue #4909)
+ Issue #4909, Issue #4916)
- The cups-lpd program did not catch all legacy usage of ISO-8859-1
(Issue #4899)
- Fixed builds on systems without a working poll() implementation
- Added a USB quirk rule for the Kyocera Ecosys P6026cdn (Issue #4900)
- The scheduler no longer creates log files on startup
(<rdar://problem/28332470>)
+ - The ippContainsString function now uses case-insensitive comparisons
+ for mimeMediaType, name, and text values in conformance with RFC 2911.
- Updated documentation (PR #4896)
- Updated localizations (PR #4894, PR #4895, PR #4904, PR #4908)
* of an IPP printer.
*/
-char * /* O - PPD filename or NULL on error */
+char * /* O - PPD filename or @code NULL@ on error */
_ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
size_t bufsize, /* I - Size of filename buffer */
ipp_t *response) /* I - Get-Printer-Attributes response */
bottom, /* Largest bottom margin */
left, /* Largest left margin */
right, /* Largest right margin */
- top; /* Largest top margin */
+ top, /* Largest top margin */
+ is_apple = 0, /* Does the printer support Apple raster? */
+ is_pdf = 0, /* Does the printer support PDF? */
+ is_pwg = 0; /* Does the printer support PWG Raster? */
pwg_media_t *pwg; /* PWG media size */
int xres, yres; /* Resolution values */
cups_lang_t *lang = cupsLangDefault();
if ((attr = ippFindAttribute(response, "document-format-supported", IPP_TAG_MIMETYPE)) != NULL)
{
+ 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, except for PostScript
+ * (which has compatibility problems over IPP with some vendors), text,
+ * TIFF, and vendor MIME media types...
+ */
+
if (!_cups_strcasecmp(format, "application/pdf"))
cupsFilePuts(fp, "*cupsFilter2: \"application/vnd.cups-pdf application/pdf 10 -\"\n");
- else if (_cups_strcasecmp(format, "application/octet-stream") && _cups_strcasecmp(format, "application/postscript") && _cups_strncasecmp(format, "application/vnd.hp-pcl", 23) && _cups_strcasecmp(format, "image/tiff") && _cups_strcasecmp(format, "text/plain"))
+ else if (_cups_strcasecmp(format, "application/octet-stream") && _cups_strcasecmp(format, "application/postscript") && _cups_strncasecmp(format, "application/vnd.", 16) && _cups_strncasecmp(format, "image/vnd.", 10) && _cups_strcasecmp(format, "image/tiff") && _cups_strncasecmp(format, "text/", 5))
cupsFilePrintf(fp, "*cupsFilter2: \"%s %s 10 -\"\n", format, format);
}
}
+ if (!is_apple && !is_pdf && !is_pwg)
+ goto bad_ppd;
+
/*
* PageSize/PageRegion/ImageableArea/PaperDimension
*/
}
}
}
+ else
+ goto bad_ppd;
/*
* InputSlot...
cupsFilePrintf(fp, "*ColorModel AdobeRGB/%s: \"<</cupsColorSpace 20/cupsBitsPerColor 16/cupsColorOrder 0/cupsCompression 0>>setpagedevice\"\n", _cupsLangString(lang, _("Deep Color")));
- default_color = "AdobeRGB";
+ if (!default_color)
+ default_color = "AdobeRGB";
}
}
* Invalid "urf-supported" value...
*/
- cupsFilePuts(fp, "*DefaultResolution: 300dpi\n");
+ goto bad_ppd;
}
else
{
cupsFilePuts(fp, "*CloseUI: *cupsPrintQuality\n");
}
}
+ else if (is_apple || is_pwg)
+ goto bad_ppd;
else if ((attr = ippFindAttribute(response, "printer-resolution-default", IPP_TAG_RESOLUTION)) != NULL)
{
pwg_ppdize_resolution(attr, 0, &xres, &yres, ppdname, sizeof(ppdname));
cupsFileClose(fp);
return (buffer);
+
+ /*
+ * If we get here then there was a problem creating the PPD...
+ */
+
+ bad_ppd:
+
+ cupsFileClose(fp);
+ unlink(buffer);
+ *buffer = '\0';
+
+ return (NULL);
}