Skip to content

ppd-generator: drop the broken URF default resolution check - #98

Merged
tillkamppeter merged 1 commit into
OpenPrinting:masterfrom
Ar-maan05:urf-default-resolution
Nov 2, 2026
Merged

tillkamppeter merged 1 commit into
OpenPrinting:masterfrom
Ar-maan05:urf-default-resolution

Conversation

@Ar-maan05

@Ar-maan05 Ar-maan05 commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

the URF default resolution check in ppdCreatePPDFromIPP2() could never match. it compared current_def to a freshly allocated cfNewResolution() so it was comparing pointers, it used resArray[i] insted of [j], and it leaked on every pass. the default always ended up as the middle resolution.

urf-supported RS300-600-1200, printer-resolution-default 1200dpi
before: *DefaultResolution: 600dpi
after:  *DefaultResolution: 600dpi

this first tried to make the loop honor printer-resolution-default, but as Michael pointed out that's about the print engine and not the raster data, so the middle resolution is the better default. now it just uses that and the loop is gone, so the generated PPD doesn't change and only the leak goes away. the comment is updated to match.

added a case to test_ppd_generator that pins the 600dpi result. it passes on top of master with #96.

Comment thread ppd/ppd-generator.c Fixed
@michaelrsweet

Copy link
Copy Markdown
Member

Note: "printer-resolution-supported" and "printer-resolution-default" are DIFFERENT from "urf-supported" and "pwg-raster-document-resolution-supported". "printer-resolution" refers to the print engine capabilities, while "urf-supported" and "pwg-raster-document-resolution-supported" refer to the raster processor's capabilities when preparing a source document for printing on the printer. In almost all cases, sending 1200dpi raster data to a 1200dpi printer is a waste of bandwidth since the printer must dither/halftone the source document based on the print engine.

the loop compared current_def to a newly allocated resolution, so it compared pointers and never matched, and it used the outer loop index. the result was always the middle resolution, and it leaked memory on every pass.

the middle resolution is the right default anyway, since printer-resolution-default is about the print engine and not the raster data. so just use it and remove the loop. no change to the generated PPD.
@Ar-maan05 Ar-maan05 changed the title ppd-generator: honor printer-resolution-default for URF printers ppd-generator: drop the broken URF default resolution check Nov 2, 2026
@Ar-maan05
Ar-maan05 force-pushed the urf-default-resolution branch from e071657 to a79edcf Compare November 2, 2026 03:39
@Ar-maan05

Copy link
Copy Markdown
Contributor Author

Thanks, that makes sense, I hadn't thought about the print engine vs the raster data! Sending 1200dpi raster to the printer just to honor that default would be a waste. So I dropped that part: the PPD keeps the middle resolution like it does today, and this now just removes the broken check and the leak that came with it.

@tillkamppeter
tillkamppeter merged commit fbc0b53 into OpenPrinting:master Nov 2, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants