RFR: 8375221: Update code to get PrinterResolution from CUPS/IPP print service

GennadiyKrivoshein duke at openjdk.org
Wed Jan 14 13:28:19 UTC 2026


On Tue, 13 Jan 2026 20:51:35 GMT, Phil Race <prr at openjdk.org> wrote:

> Previous to this fix, no resolution was being found via CUPS/IPP and when the test case for printer resolution was falling back to the made up 300dpi setting. With this fix it finds the 600dpi from CUPS/IPP.

src/java.desktop/unix/classes/sun/print/IPPPrintService.java line 1699:

> 1697:                 : null;
> 1698:             if (attribClass != null) {
> 1699:                 rawResolutions = attribClass.getIntRangeValue();

Regarding to the RFC8011, section 5.1.16 (https://datatracker.ietf.org/doc/html/rfc8011#section-5.1.16), the IPP 'resoltion' attribute consists of three values.

>The 'resolution' attribute syntax specifies a two-dimensional resolution in the indicated units. It consists of three values: a cross-feed direction resolution (positive integer value), a feed direction resolution (positive integer value), and a units value. For example, '300','600','3' indicates a 300-dpi cross-feed direction resolution and a 600-dpi feed direction resolution, since a '3' indicates dots per inch (dpi).

So the `rawResolutions = attribClass.getIntRangeValue();` and subsequent `int numRes = rawResolutions.length / 2;` looks wrong. I checked the "attribClass" value with my printer and it contains three values per resolution.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/29208#discussion_r2690423658


More information about the client-libs-dev mailing list