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

set image height for 2.13 inch display to 128 #2

Closed
gmoehler opened this issue Nov 30, 2021 · 2 comments
Closed

set image height for 2.13 inch display to 128 #2

gmoehler opened this issue Nov 30, 2021 · 2 comments

Comments

@gmoehler
Copy link

gmoehler commented Nov 30, 2021

I know it sounds strange, since all documentation says that the 2.13 image has a height of 122: But in my case it did not work with that default height returning error 2 (wrong size). When i looked at the decompiled version of class a it reveils that the code checks against height 128 resulting in the above error.
So i changed the height from 122 to 128 and everything works fine. Either it is a bug in the API (probably) or waveshare has changed the dimensions of the small display (not so probable).

@joshuatz
Copy link
Owner

joshuatz commented Dec 6, 2021

@gmoehler I think you are right on the money in that this is a bug in the API / SDK JAR, rather than an actual physical resolution mix-up. I honestly think it is probably just a typo from Waveshare. It doesn't surprise me either - when I built this, I actually had to reach out to Waveshare at one point because the JAR that was initially offed for download on their website was completely missing an entire class file and would not compile!

The fact that the error comes from a bounds check and not from the device itself, and that other codebases that talk directly to the device and don't use the SDK also use 122 instead of 128, all point to this being an SDK issue. But rather than trying to patch the JAR myself or bug Waveshare for a fix, I'm fine with just hardcoding your workaround and adding a comment.

@gmoehler
Copy link
Author

gmoehler commented Dec 6, 2021

Thanks for the fix!

mk-fg pushed a commit to mk-fg/nfc-epaper-writer that referenced this issue Jul 23, 2024
Add black, white and red custom palette dithering and upgrade project
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

2 participants