]> git.ipfire.org Git - thirdparty/cups-filters.git/commitdiff
libcupsfilters: In pdftopdf() set a default for "print-scaling"
authorTill Kamppeter <till.kamppeter@gmail.com>
Thu, 25 Nov 2021 16:25:48 +0000 (17:25 +0100)
committerTill Kamppeter <till.kamppeter@gmail.com>
Thu, 25 Nov 2021 16:25:48 +0000 (17:25 +0100)
If no setting for "print-scaling" is provided via IPP attribute pr
command line option there is no default valur for it and we get
undefined behavior and also a scary "should never happen" message in
the log.

Now we check after parsing the appropriate IPP attributes and command
line options whether a setting was provided. If not, we use "auto".

cupsfilters/pdftopdf/pdftopdf.cc

index de1693441340c8a4084e11babc46a9b5b6805d26..07cec5b8c1496be5fa23c948f971f9b473bff8c5 100644 (file)
@@ -359,6 +359,9 @@ void getParameters(filter_data_t *data,int num_options,cups_option_t *options,Pr
       param.cropfit=1;
     }
   }
+  if (!param.autoprint && !param.autofit && !param.fitplot &&
+      !param.fillprint && !param.cropfit)
+    param.autoprint = true;
   }
 
   if (ppd && (ppd->landscape < 0)) { // direction the printer rotates landscape (90 or -90)