This commit is contained in:
lizandrogd
2025-06-07 19:00:44 -05:00
parent c96bc22368
commit a34e2b7143
3 changed files with 53 additions and 0 deletions
+16
View File
@@ -149,3 +149,19 @@ func GenerateVCardQR(data ContactData) ([]byte, error) {
return buf.Bytes(), nil
}
func GenerateURlQR(url string) ([]byte, error) {
qr, err := qrcode.New(url, qrcode.Medium)
if err != nil {
return nil, err
}
img := qr.Image(300)
var buf bytes.Buffer
if err := png.Encode(&buf, img); err != nil {
return nil, err
}
return buf.Bytes(), nil
}