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

Asymmetric density #592

Merged
merged 6 commits into from
Apr 16, 2020
Merged

Asymmetric density #592

merged 6 commits into from
Apr 16, 2020

Conversation

akberenz
Copy link
Member

Adds support for asymmetric densities and named density values.

Add additional resolution support to CUPS
@tresf
Copy link
Contributor

tresf commented Mar 6, 2020

Unfortunately, due to this TODO: item and lack of density reporting from CUPS, we can't go higher than what's reported in the .ppd file as *DefaultResolution: 300dpi on my "Dymo LabelWriter 450 Turbo" on Mac.

I've added cross-feed parsing support to CUPS as well as additional resolution support.

@bberenz it appears you assume the first density is the best density e.g. bestRes = rSupport.get(0);. Are you sorting them as you're adding them? If so, can you help me do the same in my latest code?

@tresf
Copy link
Contributor

tresf commented Mar 6, 2020

... also @bberenz the best keyword isn't being honored with this new CUPS logic for some reason.

@akberenz
Copy link
Member Author

akberenz commented Mar 6, 2020

it appears you assume the first density is the best density

No, it only grabs the first resolution to ensure not null as it then loops through the whole list comparing for better (or worse if draft)

@tresf
Copy link
Contributor

tresf commented Apr 13, 2020

No, it only grabs the first resolution to ensure not null as it then loops through the whole list comparing for better (or worse if draft)

  • Fixed an order-of-operations issue where the size of the densities array is zero; done by using an empty ArrayList to signify whether or not the densities have been fetched. This may need eventual improvement down the road to address Lazy fetching of printer details when printing raw #607 but should fix this PR.
  • Changed the logic to use null as default and then set on first loop instead; guards against IndexOutOfBounds exception in the event CUPS can't parse the densities resulting in nothing at .get(0).

@tresf
Copy link
Contributor

tresf commented Apr 13, 2020

Fixed a parsing issue with /HWResolution where it assumed metric. This should be ready to test. Since many printers don't offer asymmetric densities, I'll be testing this on my Dymo Labelwriter 450, which has a density of 300x600dpi.

@tresf
Copy link
Contributor

tresf commented Apr 16, 2020

Testing is positive but also a bit inconclusive, the quality seems to remain the same between 300x300 and 600x300 on this printer, which seems rather impossible. Perhaps the driver reports a higher resolution than what is possible, but it does not appear to hinder the output, so I'm merging.

@tresf tresf merged commit 439c7bc into master Apr 16, 2020
@tresf tresf deleted the asymm-density branch April 16, 2020 17:51
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.

3 participants