Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why use pwgMediaForPPD() in _ppdCacheCreateWithPPD()? #5633

Closed
j39m opened this issue Aug 12, 2019 · 3 comments
Closed

Why use pwgMediaForPPD() in _ppdCacheCreateWithPPD()? #5633

j39m opened this issue Aug 12, 2019 · 3 comments
Assignees
Milestone

Comments

@j39m
Copy link

j39m commented Aug 12, 2019

This is a multi-part question prompted by a PPD containing the following PaperDimensions:

*PaperDimension B5/B5 (176 x 250 mm): "499 709"
*PaperDimension JISB5/JIS B5 (182 x 257 mm): "516 729"

Passing such a PPD under cupstestppd shows these warnings:

        WARN    Size "B5" should be the Adobe standard name "ISOB5".
        WARN    Size "JISB5" should be the Adobe standard name "B5".

CUPS writes the PPD cache with these Size specifications:

Size jis_b5_182x257mm B5 17604 25012 400 400 400 400
Size om_jisb-5_182.03x257.18mm JISB5 18203 25718 400 400 400 400

We have received user feedback reports that selecting either of these media to print with causes the printer to print in JIS B5; the ISO B5 (176x250mm) size is unpickable.

CUPS chooses to represent that B5 PaperDimension because it calls pwgMediaForPPD() and gets the JIS size out of it. It won't find the ISO B5 size because it calls _pwgMediaNearSize() with epsilon = 0 (17604 != 17600; 25012 != 25000). Even if we increase the epsilon, the selected PWG vendor ID will still only reflect what pwgMediaForPPD() initially chose. I assume this could confuse the printer down the line.

  1. Why does _ppdCacheCreateWithPPD() attach importance to the stated PPD media name? Can we get away with matching by size only?
  2. Why choose epsilon = 0 when calling _pwgMediaNearSize()? Can we get away with a higher epsilon as cupstestppd does?
@michaelrsweet
Copy link
Collaborator

I will need to do some digging on this; there was a reason but I don't remember it offhand... :/

@michaelrsweet michaelrsweet self-assigned this Aug 15, 2019
@michaelrsweet michaelrsweet added this to the CUPS 2.3.x milestone Aug 15, 2019
@michaelrsweet
Copy link
Collaborator

Well, changing to pwgMediaForSize seems to work, so let's go with it...

@michaelrsweet
Copy link
Collaborator

[master 9240cd7] Use pwgMediaForSize when looking up PPD sizes (Issue #5633)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants