RFR: 8375221: Update code to get PrinterResolution from CUPS/IPP print service [v2]
Phil Race
prr at openjdk.org
Thu Jan 15 17:51:00 UTC 2026
On Wed, 14 Jan 2026 13:25:14 GMT, GennadiyKrivoshein <duke at openjdk.org> wrote:
>> Phil Race has updated the pull request incrementally with one additional commit since the last revision:
>>
>> 8375221
>
> 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.
Right. The 3rd value is the resolution unit ID (3 for DPI, 4 for DPCM). Since the AttributeClass method wasn't reading it, I assumed DPI which seems to be the general case, and FWIW is all the PPDs seem to support.
The units ID is a byte, so I had to add a special method to AttributeClass.
Then now that it returns 3 values, I decided to make the PPD code also return a units ID, so all cases could be processed similarly.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/29208#discussion_r2695361406
More information about the client-libs-dev
mailing list