libcupsfilters: Fix orientation-requested = 0 in pdftopdf()
CUPS often adds "orientation-requested=0" to the options in the
filter/backend command line, meaning automatic selection. pdftopdf()
did not support this value and therefore did not do the correct
settings making margins of rotated landscape pages not be done
correctly.
@@ -381,10 +381,12 @@ void getParameters(filter_data_t *data,int num_options,cups_option_t *options,Pr
* 3: 0 degrees, 4: 90 degrees, 5: -90 degrees, 6: 180 degrees
*/
if ((ipprot<3)||(ipprot>6)) {
- if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_ERROR,
+ if (ipprot && doc->logfunc)
+ doc->logfunc(doc->logdata, FILTER_LOGLEVEL_ERROR,
"pdftopdf: Bad value (%d) for "
"orientation-requested, using 0 degrees",
ipprot);
+ param.noOrientation = true;
} else {
static const Rotation ipp2rot[4]={ROT_0, ROT_90, ROT_270, ROT_180};
param.orientation=ipp2rot[ipprot-3];
