better control of qr genration

This commit is contained in:
2020-02-01 16:32:30 -06:00
parent 9c37ed5960
commit 18422f8d65
3 changed files with 19 additions and 6 deletions

View File

@@ -9,9 +9,9 @@ default: $(TARGET)
$(TARGET): $(INPUT) Makefile $(QR) $(TARGET): $(INPUT) Makefile $(QR)
$(TEX) $< && $(TEX) $< $(TEX) $< && $(TEX) $<
$(QR): event.txt $(QR): qrEvent_vi.txt
cat $< | qr > $@ ./qrGen.py
clean: clean:
rm -f $(DOC).{pdf,out,aux,log} rm -f $(DOC).{pdf,out,aux,log} $(QR)
rm -f *.{pdf,out,aux,log,bbl,blg} rm -f *.{pdf,out,aux,log,bbl,blg}

View File

@@ -2,9 +2,8 @@ BEGIN:VCALENDAR
VERSION:2.0 VERSION:2.0
BEGIN:VEVENT BEGIN:VEVENT
SUMMARY:Đám cưới Nam-Hương SUMMARY:Đám cưới Nam-Hương
DTSTART:20200301 DTSTART;TZID=Asia/Saigon:20200301T160000
DTEND:20200301 DTEND;TZID=Asia/Saigon:20200301T200000
DTSTAMP:20200301T140000
LOCATION:Nhà hàng Âu Cơ, 1A Nguyễn Hữu Cầu, P. Ngọc Châu, Thành phố Hải Dương, Hải Dương, Vietnam LOCATION:Nhà hàng Âu Cơ, 1A Nguyễn Hữu Cầu, P. Ngọc Châu, Thành phố Hải Dương, Hải Dương, Vietnam
GEO:20.9351879;106.3433482,18 GEO:20.9351879;106.3433482,18
URL:https://goo.gl/maps/eyfMhXgjFTQzAWB79 URL:https://goo.gl/maps/eyfMhXgjFTQzAWB79

14
wedding-invitation/qrGen.py Executable file
View File

@@ -0,0 +1,14 @@
#!/usr/bin/env python3
import qrcode
qr = qrcode.QRCode(
version=2,
error_correction=qrcode.constants.ERROR_CORRECT_Q,
box_size=5,
border=1)
with open("qrEvent_vi.txt") as fp:
qr.add_data(fp.read())
qr.make(fit=True)
img = qr.make_image(fill_color="orangered", back_color="white")
img.save("qr.png")