make QR for telegram borderless

This commit is contained in:
Dmitry Verkhoturov
2022-02-15 18:33:51 -06:00
committed by Umputun
parent f448208475
commit f03fcf3fcf
2 changed files with 7 additions and 1 deletions
+7 -1
View File
@@ -384,7 +384,13 @@ func (s *public) telegramQrCtrl(w http.ResponseWriter, r *http.Request) {
return
}
png, err := qrcode.Encode(text, qrcode.Medium, 256)
q, err := qrcode.New(text, qrcode.Medium)
if err != nil {
rest.SendErrorJSON(w, r, http.StatusInternalServerError, err, "can't generate QR", rest.ErrInternal)
return
}
q.DisableBorder = true
png, err := q.PNG(256)
if err != nil {
rest.SendErrorJSON(w, r, http.StatusInternalServerError, err, "can't generate QR", rest.ErrInternal)
return
Binary file not shown.

Before

Width:  |  Height:  |  Size: 430 B

After

Width:  |  Height:  |  Size: 468 B