From 4c1c82afec96f6ac2b5c7ace3a133647feb1910f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B4=D1=80=D0=B5=D0=B9=20=D0=91=D0=BE=D0=B1?= =?UTF-8?q?=D1=8B=D1=80=D0=B5=D0=B2?= Date: Sun, 31 May 2026 15:21:38 +0300 Subject: [PATCH] stable 1.2.8: scannable QR (ECC L + native size) Co-Authored-By: Claude Opus 4.8 --- VERSION | 2 +- app.py | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/VERSION b/VERSION index c04c650..db6fb4a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.2.7 +1.2.8 diff --git a/app.py b/app.py index b4cafac..ae35af5 100644 --- a/app.py +++ b/app.py @@ -764,8 +764,13 @@ def _pad_conf_with_none(conf): def qr_datauri(data): try: import qrcode, io, base64 + qr = qrcode.QRCode(error_correction=qrcode.constants.ERROR_CORRECT_L, + box_size=4, border=3) + qr.add_data(data) + qr.make(fit=True) + img = qr.make_image(fill_color="black", back_color="white") buf = io.BytesIO() - qrcode.make(data).save(buf, format="PNG") + img.save(buf, format="PNG") return "data:image/png;base64," + base64.b64encode(buf.getvalue()).decode() except Exception: return "" @@ -1689,7 +1694,7 @@ def client_phone(cid, mode): {nav('clients')}

{cid} — {title}

- QR
+ QR

{tr("Отсканируй QR в приложении или импортируй конфиг:", "Scan the QR in the app or import the config:")}

{extra}