]> git.ipfire.org Git - thirdparty/cups-filters.git/commitdiff
libcupsfilters: In pwgtoraster() with PPD do not modify header via IPP options
authorTill Kamppeter <till.kamppeter@gmail.com>
Wed, 20 Oct 2021 14:51:15 +0000 (16:51 +0200)
committerTill Kamppeter <till.kamppeter@gmail.com>
Wed, 20 Oct 2021 14:51:15 +0000 (16:51 +0200)
In the pwgtoraster() filter function, if we have a PPD file, we do not
call cupsRasterParseIPPOptions() as it sets the Raster header entries
solely by the names and choice names of the IPP attributes and command
line options, regardless of what the PPD supports. This broke some
jobs.

If we have a PPD, we need to convert IPP attributes into proper PPD
options before calling the filter functions (what is done by
libpappl-retrofit for example).

cupsfilters/pwgtoraster.c

index 04d8af840fdd3e4fdf64bbc3d39b3be5fce030f3..59d922b551ee5f6f2bb7f3d1a60f5a9faecfce1e 100644 (file)
@@ -321,6 +321,8 @@ static void parseOpts(filter_data_t *data,
      cupsGetOption("media-col", num_options, options));
 
   if (doc->ppd) {
+    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+                "pwgtoraster: Using PPD file: %s", doc->ppd->nickname);
     ppdMarkOptions(doc->ppd,num_options,options);
     handleRequiresPageRegion(doc);
     ppdRasterInterpretPPD(&(doc->outheader),doc->ppd,num_options,options,0);
@@ -395,8 +397,6 @@ static void parseOpts(filter_data_t *data,
       doc->color_profile.colorProfile = cmsOpenProfileFromFile(profile,"r");
       free(profile);
     }
-
-    cupsRasterParseIPPOptions(&(doc->outheader), data, 0, 0);
   } else {
 #ifdef HAVE_CUPS_1_7
     cupsRasterParseIPPOptions(&(doc->outheader), data, 0, 1);