Add IPng logo and address
This commit is contained in:
9
GENERATED_ipng.go
Normal file
9
GENERATED_ipng.go
Normal file
File diff suppressed because one or more lines are too long
@@ -46,11 +46,11 @@ func qrchFromRequest(r *http.Request) *qrbill.QRCH {
|
|||||||
IBAN: ifEmpty(r.Form, "criban", "CH0209000000870913543"),
|
IBAN: ifEmpty(r.Form, "criban", "CH0209000000870913543"),
|
||||||
Cdtr: qrbill.Address{
|
Cdtr: qrbill.Address{
|
||||||
AdrTp: qrbill.AddressType(ifEmpty(r.Form, "craddrtype", string(qrbill.AddressTypeStructured))),
|
AdrTp: qrbill.AddressType(ifEmpty(r.Form, "craddrtype", string(qrbill.AddressTypeStructured))),
|
||||||
Name: ifEmpty(r.Form, "crname", "Legalize it"),
|
Name: ifEmpty(r.Form, "crname", "IPng Networks GmbH"),
|
||||||
StrtNmOrAdrLine1: ifEmpty(r.Form, "craddr1", "Quellenstrasse"),
|
StrtNmOrAdrLine1: ifEmpty(r.Form, "craddr1", "Im Bungert"),
|
||||||
BldgNbOrAdrLine2: ifEmpty(r.Form, "craddr2", "25"),
|
BldgNbOrAdrLine2: ifEmpty(r.Form, "craddr2", "14"),
|
||||||
PstCd: ifEmpty(r.Form, "crpost", "8005"),
|
PstCd: ifEmpty(r.Form, "crpost", "8306"),
|
||||||
TwnNm: ifEmpty(r.Form, "crcity", "Zürich"),
|
TwnNm: ifEmpty(r.Form, "crcity", "Brüttisellen"),
|
||||||
Ctry: ifEmpty(r.Form, "crcountry", "CH"),
|
Ctry: ifEmpty(r.Form, "crcountry", "CH"),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -60,18 +60,18 @@ func qrchFromRequest(r *http.Request) *qrbill.QRCH {
|
|||||||
},
|
},
|
||||||
UltmtDbtr: qrbill.Address{
|
UltmtDbtr: qrbill.Address{
|
||||||
AdrTp: qrbill.AddressType(ifEmpty(r.Form, "udaddrtype", string(qrbill.AddressTypeStructured))),
|
AdrTp: qrbill.AddressType(ifEmpty(r.Form, "udaddrtype", string(qrbill.AddressTypeStructured))),
|
||||||
Name: ifEmpty(r.Form, "udname", "Michael Stapelberg"),
|
Name: ifEmpty(r.Form, "udname", "IPng Networks GmbH"),
|
||||||
StrtNmOrAdrLine1: ifEmpty(r.Form, "udaddr1", "Stauffacherstr"),
|
StrtNmOrAdrLine1: ifEmpty(r.Form, "udaddr1", "Im Bungert"),
|
||||||
BldgNbOrAdrLine2: ifEmpty(r.Form, "udaddr2", "42"),
|
BldgNbOrAdrLine2: ifEmpty(r.Form, "udaddr2", "14"),
|
||||||
PstCd: ifEmpty(r.Form, "udpost", "8004"),
|
PstCd: ifEmpty(r.Form, "udpost", "8306"),
|
||||||
TwnNm: ifEmpty(r.Form, "udcity", "Zürich"),
|
TwnNm: ifEmpty(r.Form, "udcity", "Brüttisellen"),
|
||||||
Ctry: ifEmpty(r.Form, "udcountry", "CH"),
|
Ctry: ifEmpty(r.Form, "udcountry", "CH"),
|
||||||
},
|
},
|
||||||
RmtInf: qrbill.QRCHRmtInf{
|
RmtInf: qrbill.QRCHRmtInf{
|
||||||
Tp: "NON", // Reference type
|
Tp: "NON", // Reference type
|
||||||
Ref: "", // Reference
|
Ref: "", // Reference
|
||||||
AddInf: qrbill.QRCHRmtInfAddInf{
|
AddInf: qrbill.QRCHRmtInfAddInf{
|
||||||
Ustrd: ifEmpty(r.Form, "message", "Spende 420"),
|
Ustrd: ifEmpty(r.Form, "message", "IPng Networks GmbH invoice"),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
57
logo.svg
Normal file
57
logo.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 8.2 KiB |
@@ -318,8 +318,8 @@ func (b *Bill) EncodeToSVG() ([]byte, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// overlay the swiss cross
|
// overlay the IPng Logo
|
||||||
cross := swisscross["swisscross.svg"]
|
cross := ipng["logo.svg"]
|
||||||
// Remove XML document header, we embed the <svg> element:
|
// Remove XML document header, we embed the <svg> element:
|
||||||
cross = bytes.ReplaceAll(cross, []byte(`<?xml version="1.0" encoding="utf-8"?>`), nil)
|
cross = bytes.ReplaceAll(cross, []byte(`<?xml version="1.0" encoding="utf-8"?>`), nil)
|
||||||
// Overwrite position and size of the embedded <svg> element:
|
// Overwrite position and size of the embedded <svg> element:
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ func generateQrCodeImage(payload string) (image.Image, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func overlayWithSwissCross(qrCodeImage image.Image) (image.Image, error) {
|
func overlayWithSwissCross(qrCodeImage image.Image) (image.Image, error) {
|
||||||
b := swisscross["third_party/swiss-cross/CH-Kreuz_7mm/CH-Kreuz_7mm.png"]
|
b := ipng["logo-inverted.png"]
|
||||||
swissCrossImage, _, err := image.Decode(bytes.NewReader(b))
|
swissCrossImage, _, err := image.Decode(bytes.NewReader(b))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|||||||
Reference in New Issue
Block a user