-CHANGES.txt - 1.7b1 - 2013-03-11
+CHANGES.txt - 1.7b1 - 2013-04-03
--------------------------------
CHANGES IN CUPS V1.7b1
+ - The cupsfilter program did not set the FINAL_CONTENT_TYPE
+ environment variable for filters.
- Added a new "-x" option to the cancel command (STR #4103)
- Made the PWG media handling APIs public (STR #4267)
- Implemented ready media support for the cupsGetDestMediaXxx APIs
{
int i; /* Looping var */
const char *argv[8], /* Command-line arguments */
- *envp[16], /* Environment variables */
+ *envp[17], /* Environment variables */
*temp; /* Temporary string */
char *optstr, /* Filter options */
content_type[1024], /* CONTENT_TYPE */
cups_fontpath[1024], /* CUPS_FONTPATH */
cups_serverbin[1024], /* CUPS_SERVERBIN */
cups_serverroot[1024], /* CUPS_SERVERROOT */
+ final_content_type[1024] = "",
+ /* FINAL_CONTENT_TYPE */
lang[1024], /* LANG */
path[1024], /* PATH */
ppd[1024], /* PPD */
cups_dest_t *dest; /* Destination information */
+ /*
+ * Figure out the final content type...
+ */
+
+ for (filter = (mime_filter_t *)cupsArrayLast(filters);
+ filter && filter->dst;
+ filter = (mime_filter_t *)cupsArrayPrev(filters))
+ if (strcmp(filter->dst->super, "printer"))
+ break;
+
+ if (filter && filter->dst)
+ {
+ const char *ptr; /* Pointer in type name */
+
+ if ((ptr = strchr(filter->dst->type, '/')) != NULL)
+ snprintf(final_content_type, sizeof(final_content_type),
+ "FINAL_CONTENT_TYPE=%s", ptr + 1);
+ else
+ snprintf(final_content_type, sizeof(final_content_type),
+ "FINAL_CONTENT_TYPE=%s/%s", filter->dst->super,
+ filter->dst->type);
+ }
+
+ /*
+ * Remove NULL ("-") filters...
+ */
+
+ for (filter = (mime_filter_t *)cupsArrayFirst(filters);
+ filter;
+ filter = (mime_filter_t *)cupsArrayNext(filters))
+ if (!strcmp(filter->filter, "-"))
+ cupsArrayRemove(filters, filter);
+
/*
* Setup the filter environment and command-line...
*/
envp[12] = rip_max_cache;
envp[13] = userenv;
envp[14] = "CHARSET=utf-8";
- envp[15] = NULL;
+ if (final_content_type[0])
+ {
+ envp[15] = final_content_type;
+ envp[16] = NULL;
+ }
+ else
+ envp[15] = NULL;
for (i = 0; argv[i]; i ++)
fprintf(stderr, "DEBUG: argv[%d]=\"%s\"\n", i, argv[i]);