[cups.bugs] [MOD] STR #2513: New handling of CUPS option defaults in CUPS 1.3 broken

Till Kamppeter till.kamppeter at gmail.com
Fri Sep 14 07:59:55 PDT 2007


DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

See my bug report

http://www.cups.org/str.php?L2502

There the imagetops filter did not auto-rotate my image to the landscape
rotation because the option setting

orientation-requested=3

was applied. But this setting was not applied by me. I checked the options
in printers.conf, the PPD file, and in ~/.cups/lpoptions.

Then I looked into the CUPS source code to find out whether the CUPS
daemon or the CUPS library sets thios options.

I have found the following having been added to the scheduler/printers.c
file, in the add_printer_defaults() function beginning from CUPS 1.3.0:

---------------------------------------------------------------------
  if (!CommonDefaults)
  {
    CommonDefaults = cupsArrayNew((cups_array_func_t)strcmp, NULL);

    cupsArrayAdd(CommonDefaults, _cupsStrAlloc("copies-default"));
    cupsArrayAdd(CommonDefaults,
_cupsStrAlloc("document-format-default"));
    cupsArrayAdd(CommonDefaults, _cupsStrAlloc("finishings-default"));
    cupsArrayAdd(CommonDefaults, _cupsStrAlloc("job-hold-until-default"));
    cupsArrayAdd(CommonDefaults, _cupsStrAlloc("job-priority-default"));
    cupsArrayAdd(CommonDefaults, _cupsStrAlloc("job-sheets-default"));
    cupsArrayAdd(CommonDefaults, _cupsStrAlloc("media-default"));
    cupsArrayAdd(CommonDefaults, _cupsStrAlloc("number-up-default"));
    cupsArrayAdd(CommonDefaults,
      _cupsStrAlloc("orientation-requested-default"));
    cupsArrayAdd(CommonDefaults, _cupsStrAlloc("sides-default"));
  }
---------------------------------------------------------------------

which looks like that all options get defaults now. including
"orientation-requested". But "orientation-requested" has only the four
values to force orientations, no fifth value for auto-selection. So
setting one of the four with this default definition makes auto-rotation
of images impossible.

As a workaround I have commented out the line for "orientation-requested"
in the code piece from above:

---------------------------------------------------------------------
  [...]
    cupsArrayAdd(CommonDefaults, _cupsStrAlloc("number-up-default"));
    /* cupsArrayAdd(CommonDefaults,
      _cupsStrAlloc("orientation-requested-default")); */
    cupsArrayAdd(CommonDefaults, _cupsStrAlloc("sides-default"));
  }
---------------------------------------------------------------------

and, recompiled the scheduler and replaced the system's scheduler by this
one.

Now auto-rotation works for me.

Commenting out/removing the lines for options where forcing a default
leads to unwished effects is a workaround, better would be to add an
"auto" choice to such options and to make this the default.

Please check this also with the other options.

Link: http://www.cups.org/str.php?L2513
Version: 1.3.0





More information about the cups-devel mailing list