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

Resolution Syntax #81

Open
JonasKruckenberg opened this issue Oct 29, 2019 · 1 comment
Open

Resolution Syntax #81

JonasKruckenberg opened this issue Oct 29, 2019 · 1 comment

Comments

@JonasKruckenberg
Copy link

I've been working on a few additions to this repos serialization, pull request will come as soon as I get more progress done. So far I stumbled upon this part in the function regarding the resolution value.
Is there a syntax for specifying the resolution that I'm not aware of?
I tried the following
'printer-resolution-default': '400dpi'
the results after serializing and parsing for testings sake is this:
'printer-resolution-default': [ 4, 0, 'dpcm' ]

Is this intentional behavior? Since the code doesn't allow us to use arrays as a value here so this
'printer-resolution-default': [400,400,'dpi']
does not work, at the same time the code expects element value[2]==='dpi wich is clearly not possible if you are not allowing the use of arrays here.
I've been a bit hesitant to change the behavior in my local copy to use arrays since it doesn't seem to be an easy fix.
What do you think, is there something I'm missing or is this a bug?
Cheers, Jonas

@JonasKruckenberg
Copy link
Author

JonasKruckenberg commented Oct 29, 2019

I've updated my fork of IPP with what I propose as an easy fix, it's a hacky though and it uses a regex so maybe a bit on the slow side. What do you think?

The new syntax is
[cross-feed-resolution]x[feed-resolution]dpi or dpcm

So for example 400x400dpi or 300x400dpcm. This is similar to how ipptools represents it I think.
For completion the reference is RFC8011

My fix is on this branch, ignore references in this thread, it’s because I organized the code a bit for potential pull requests!

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

No branches or pull requests

1 participant