QR code scanning: embed the webcam in Tor Connection
-
If we do that, ideally we should mirror the webcam's display. But If the QR code finally becomes smaller, and thus simpler to scan, this will become much less important.
-
Debian ships this as libzbargtk0
-
Once upon a time (Python 2, GTK 2), this had a Python bindings generated automatically, and packaged as python-zbargtk in Debian
-
@pierov wrote bindings in C, with a function to generate a widget, and a few other additional functions (get/set webcam device, enable/disable video capture, set the resolution for the widget): !878
pierov's notes:
-
the C library is pretty standard GTK stuff: with some magic, we can convert the C struct to a Python GTK object, and then append it to other widgets generated in Python, add a signal to get the decoded text, etc etc
-
for the rest of the C function, I implemented some C wrappers: not very elegant, but they work
-
ideally, I should improve everything and then open a PR upstream
-
To build:
- install a few development packages (python3-dev, libzbargtk-dev, python-gi-dev)
- run
python setup.py build
- copy
build/lib.linux-x86_64-3.xx/zbargtk.cpython-3xx-x86_64-linux-gnu.so
to/usr/lib/python3/dist-packages
or wherever you prefer (/usr/local/...)
-
but first, where do I put the C file and build.py? →
config/chroot_local-includes/usr/src/$NAME
please, thanks! :)
-