QR Code Tips
Scanning QR Codes
Quirc
The demo tools from the Quirc library can be used to scan QR Codes with a built in camera.
The demo tools can be built on macOS using MacPorts:
Install the required packages:
$ sudo port install gmake libsdl jpeg libsdl_gfx opencv4-devel
Note that this also installs
libquirc
as a dependency ofopencv4-devel
, but this port does not include the demo applications that we want.Set environment variables for the build:
$ export PKG_CONFIG_PATH=/opt/local/lib/opencv4/pkgconfig $ export CFLAGS='-I/opt/local/include' $ export LDFLAGS='-L/opt/local/lib'
Build the library:
$ gmake
Build
quirc-demo-opencv
:$ gmake quirc-demo-opencv
Build
inspect-opencv
:$ gmake inspect-opencv
Build
inspect
:$ gmake inspect
See the README.me file for usage.
zbar
The zbar Bar Code Reader can also be used to read QR Codes. It is
available on MacPorts as the zbar
port.
$ sudo port install zbar
There are variants for this port. port variants zbar
will list them.
See the zbar README.md for usage instructions.
Encoding QR Codes
libqrencode provides a command line utility, qrencode
to easily create
QR Codes. Install on MacPorts with:
$ sudo port install qrencode
Common QR Code Formats
See also https://github.com/zxing/zxing/wiki/Barcode-Contents for a list of commonly used formats.
-- Frank Dean - 22 Jul 2023
Related Topics: OneTimePasswords