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

Generated QRCode default margin is too narrow #520

Open
QJKX opened this issue Feb 10, 2025 · 2 comments
Open

Generated QRCode default margin is too narrow #520

QJKX opened this issue Feb 10, 2025 · 2 comments

Comments

@QJKX
Copy link

QJKX commented Feb 10, 2025

A standard compliant QRCode has a margin of 4+ modules - the "quiet zone".
https://www.qrcode.com/en/howto/code.html

Currently BinaryEye defaults to a 4 pixel margin - too narrow because modules:pixels is not 1:1.

Zxing defaults to a 4 module margin, which is ideal - it dynamically chooses the perfect number of pixels depending on the code size.
BinaryEye requires a MARGIN value, so it's not possible to use that default Zxing behaviour.

https://github.com/zxing/zxing/blob/6ae11863c7082cfeb62fa5075a488ec9588a01e6/core/src/main/java/com/google/zxing/qrcode/QRCodeWriter.java#L73

@QJKX
Copy link
Author

QJKX commented Feb 10, 2025

ZXing can turn off scaling so modules:pixels is 1:1 (untested)

https://github.com/zxing/zxing/blob/6ae11863c7082cfeb62fa5075a488ec9588a01e6/core/src/main/java/com/google/zxing/qrcode/QRCodeWriter.java#L86C1-L87C47

   * <p>If no scaling is required, both {@code width} and {@code height}
   * arguments should be non-positive numbers.

For my use case 1:1 is fine - anything I use them for scales automatically.

@markusfisch
Copy link
Owner

This is known issue that stems from ZXingCpp using just pixels for measuring the margin 😬 Please note that this app is using ZXingCpp, not ZXing.

This issue is on my list of improvements, and I hope to fix it in the future.

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