Skip to content
Permalink
main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
import qrcode
# This is a piece of code to generate a VR code. If you want to use this for badger, you'll need to also do the following -
# - reduce the image to 1 bit
# - resize the qr code to 104x104
# - resize the canvas to 104 x 128
# - convert to a bin blob () using convert.py ("convert.py --binary qr.png")
# - load it into the images directory on the badge
# HINT - encoding a comblete VCARD as given below often ends up with something unreadable on the badge - better to have your contact
# details online and the QR code just point to them (Android prefers it what way as well)
vcard = '''BEGIN:VCARD
VERSION:3.0
N:Mitchell;Faye;;Dr;
FN:Faye Mitchell
ORG:Coventry University;
TITLE:Acting Head of School
EMAIL;type=INTERNET;type=WORK;type=pref:ac9207@coventry.ac.uk
END:VCARD'''
img = qrcode.make('https://linuxlady.coventry.domains/Dr-Faye-Mitchell---Contact-Information')
type(img) # qrcode.image.pil.PilImage
img.save("qr.png")