Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added an option to change the size of the QR-Code #21

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ Here below the new configuration options available in the `pibooth`_ configurati
# Location on 'print' state: topleft, topright, bottomleft, bottomright, midtop-left, midtop-right, midbottom-left, midbottom-right
print_location = bottomright

# Size of the QR-Code in nummeric steps (Default = 4)
size = 4

.. note:: Edit the configuration by running the command ``pibooth --config``.

QR code URL
Expand Down
7 changes: 4 additions & 3 deletions pibooth_qrcode.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ def pibooth_configure(cfg):
cfg.add_option(SECTION, 'print_location', "bottomright",
"Location on 'print' state: {}".format(', '.join(LOCATIONS)),
"Location on print screen", LOCATIONS)

cfg.add_option(SECTION, 'size', "4",
"Size of QR code", "Size", "4")

def get_qrcode_rect(win_rect, qrcode_image, location, offset):
sublocation = ''
Expand Down Expand Up @@ -139,8 +140,8 @@ def state_processing_exit(cfg, app):
raise ModuleNotFoundError("No module named 'qrcode'")
qr = qrcode.QRCode(version=1,
error_correction=qrcode.constants.ERROR_CORRECT_L,
box_size=3,
border=1)
box_size=cfg.gettyped("QRCODE", 'size'),
border=4)

url_vars = {'picture': app.picture_filename,
'count': app.count,
Expand Down