OpenPrinting / cups

OpenPrinting CUPS Sources
https://openprinting.github.io/cups
Apache License 2.0
958 stars 174 forks source link

Shared IPP printer reports only a single resolution in `pwg-raster-document-resolution-supported` #901

Closed ValdikSS closed 3 months ago

ValdikSS commented 4 months ago

Describe the bug

Similar to #445, but for shared printers.

When the printer is shared over IPP, pwg-raster-document-resolution-supported value is filled only with a single resolution (a first one in PPD file) and not a set of resolutions, and it is NOT a default resolution.

If the PPD file contains a list of resolutions from lower to higher, only the first lower one would be advertised in pwg-raster-document-resolution-supported.

$ ipptool -tv 'ipp://uowprint.local:631/printers/HP_LaserJet_M1005' get-printer-attributes.test | grep 'resolution)'
        printer-resolution-supported (1setOf resolution) = 600dpi,1200dpi
        pwg-raster-document-resolution-supported (resolution) = 600dpi
        printer-resolution-default (resolution) = 1200dpi

https://github.com/OpenPrinting/cups/blob/c220e7836b700563516e152ce629ff59b1b23de7/scheduler/printers.c#L4678-L4683

To Reproduce Steps to reproduce the behavior:

  1. Add a PPD file which lists resolutions from lower to higher
  2. Run ipptool to check the resolutions

Expected behavior

pwg-raster-document-resolution-supported field contains a set (array) of resolutions, not a single resolution.

System Information:

michaelrsweet commented 4 months ago

With respect, it is worthless to list PWG Raster resolutions beyond 720dpi, and in fact most real IPP Everywhere/AirPrint printers don't support input raster beyond 720dpi. The very slight improvement in edge detail is matched with a 4x increase in print data size that dramatically affects print speed and resource usage...

Conceptually we should be listing all resolutions <= 720dpi, but the current code just lists the first resolution in the PPD file for simplicity since basically all CUPS servers support (vector) PDF which is preferred over raster data by Android, ChromeOS, iOS, Linux, macOS, and Windows clients...

Will see if I can come up with something for CUPS 2.5, but I'm not going to worry about backporting to 2.4.x since the raster path is rarely used...

ValdikSS commented 4 months ago

@michaelrsweet you're right, this is a minor nitpick. Most of my laser printers have only 600 or 1200 DPI in PPD, so at least for lasers printing raster data in 600 DPI is not an issue.

I was experimenting with raster processing due to https://github.com/OpenPrinting/cups-filters/issues/569, and found this issue.

Another issue is that Windows fails to add shared printer if pwg-raster-document-resolution-supported value is less than 100×100 DPI (I was testing with 75×75). I don't have such PPDs, but I guess it could be true for some label printers.

michaelrsweet commented 3 months ago

[master 31ab57dd1] Update cupsd code to report all supported raster resolutions (Issue #901)