Render QR codes pixel-exact with an own encoder
nxhmi.qr is a dependency-free QR encoder. Measured in the Editor simulator: numeric/alphanumeric/byte mode by content, level L, mask 0, smallest version; scaled to w - 2*dis by width (not clipped to h), last column run one pixel narrower, logo centred, nothing when too small. Basic rendering is now 20/20 pixel-exact. Also: unknown component kinds give a clean CLI error instead of a traceback. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f0bcc608b1
commit
842591a14c
10 files changed
+429
-9
No files matched your search
+5
-1
@@ -201,7 +201,11 @@ def main(argv=None):
|
||||
s = sub.add_parser("dump", help="print pages as JSON"); s.add_argument("hmi"); s.add_argument("--page")
|
||||
s.add_argument("--encoding", default="latin-1"); s.add_argument("--raw", action="store_true"); s.set_defaults(f=cmd_dump)
|
||||
a = ap.parse_args(argv)
|
||||
return a.f(a) or 0
|
||||
try:
|
||||
return a.f(a) or 0
|
||||
except (ValueError, KeyError) as e:
|
||||
print("error:", e.args[0] if e.args else e, file=sys.stderr)
|
||||
return 2
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in new issue
Block a user