I browse through few sites but did not find a code snippet to decode a QR code image in javascript. I gone through qrCode.js but all it has is QR code generator . I am looking for a qr code decoder which can decode a base64 QR image and get me the details.
There is a JavaScript port of a Java library for reading qr codes: Web QR
The code can be found on GitHub
From the readme:
Usage:
Include the scripts in the following order:
<script type="text/javascript" src="grid.js"></script> <script type="text/javascript" src="version.js"></script> <script type="text/javascript" src="detector.js"></script> <script type="text/javascript" src="formatinf.js"></script> <script type="text/javascript" src="errorlevel.js"></script> <script type="text/javascript" src="bitmat.js"></script> <script type="text/javascript" src="datablock.js"></script> <script type="text/javascript" src="bmparser.js"></script> <script type="text/javascript" src="datamask.js"></script> <script type="text/javascript" src="rsdecoder.js"></script> <script type="text/javascript" src="gf256poly.js"></script> <script type="text/javascript" src="gf256.js"></script> <script type="text/javascript" src="decoder.js"></script> <script type="text/javascript" src="qrcode.js"></script> <script type="text/javascript" src="findpat.js"></script> <script type="text/javascript" src="alignpat.js"></script> <script type="text/javascript" src="databr.js"></script>
To get the decoded information set:
qrcode.callback = function(decodedData) { //... }
Decode image with:
qrcode.decode(url or DataURL)
Decode from canvas with "qr-canvas" ID:
qrcode.decode()
An example can be also found in the repo.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With