-
Notifications
You must be signed in to change notification settings - Fork 178
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
Fix duplicate PPD->IPP media-type name mappings #688
Fix duplicate PPD->IPP media-type name mappings #688
Conversation
35442c5
to
d4f91f4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally good, some coding style fixes needed plus one error when adding up the "auto" values.
@michaelrsweet here I wasn't sure whether this is something we should tackle, because it seems like PPD problem to me and we could report a warning when reading the file plus use the first/the last value of the same translation string. |
@zdohnal It isn't unusual for a PPD file to contain some odd media type names, and the proposed change is reasonable to preserve the ability to select any PPD media type via IPP. |
d4f91f4
to
9b0c59e
Compare
Thanks for the review! I've implemented all of your recommended changes except for the one about the evaluation order of the chained assignment, which I replied to. |
If more than one MediaType in a PPD matched the pattern for a registered PWG media-type name, they would all be mapped to that name, making it impossible for a client using CUPS' IPP interface to distinguish between them or specify a particular one. This comes up with Epson-provided PPDs, which frequently hit this case by combining print quality with media type like so: *MediaType PLAIN_HIGH/Plain paper-High: " *MediaType PLAIN_NORMAL/Plain paper-Standard: " Solve this problem by not assigning the standard PWG name to either one when such duplication occurs.
9b0c59e
to
55f5b24
Compare
Implemented the last suggested change, using a temporary variable for the sum of the "auto" values. |
If more than one MediaType in a PPD matched the pattern for a registered PWG media-type name, they would all be mapped to that name, making it impossible for a client using CUPS' IPP interface to distinguish between them or specify a particular one.
This comes up with Epson-provided PPDs like this one, which frequently hit this case by combining print quality with media type like so:
Solve this problem by not assigning the standard PWG name to either one when such duplication occurs.