Peer invitation refactor, Contact invitationId, Qrcode compression
This commit is contained in:
@ -3,7 +3,6 @@ package meowlib
|
||||
import (
|
||||
"bytes"
|
||||
"compress/gzip"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"image"
|
||||
"image/color"
|
||||
@ -96,13 +95,14 @@ func (contact *ContactCard) WritePng(filename string) {
|
||||
}
|
||||
|
||||
func (Contact *ContactCard) WriteQr(filename string) {
|
||||
jsonContact, _ := json.Marshal(Contact)
|
||||
//jsonContact, _ := json.Marshal(Contact)
|
||||
jsonContact, _ := Contact.Compress()
|
||||
qwriter := qrcode.NewQRCodeWriter()
|
||||
code, err := qwriter.Encode(string(jsonContact), gozxing.BarcodeFormat_QR_CODE, 512, 512, nil)
|
||||
if err != nil {
|
||||
println(err.Error())
|
||||
}
|
||||
file, _ := os.Create("barcode.png")
|
||||
file, _ := os.Create(filename)
|
||||
defer file.Close()
|
||||
|
||||
// *BitMatrix implements the image.Image interface,
|
||||
|
Reference in New Issue
Block a user