6/24/2019 0 Comments Qr Code Scanner From ImageTL;DR: I need a way to decode a QR-code from an image file using (preferable pure) Python. Is there a scan limit for the QR codes? There is no limit and the created QR code will work forever. Scan it is many times as you wish! Is QRCode Monkey saving my data? We do not save or reuse your data in any form. We cache your qr code image files for 24h on our server to optimize the performance of QRCode Monkey. I've got a jpg file with a QR-code which I want to decode using Python. I've found a couple libraries which claim to do this: PyQRCode (website here) which supposedly can decode qr codes from images by simply providing a path like this: So I simply installed it using ZBar (website here) claims to be QRTools, which according to this blogpost can decode images easily by using the following code: So I tried installing it using Although this seems to decode it, It doesn't seem to do it correctly. It furthermore needs ZBar and is thus not pure Python. So I decided to find yet another library. PyXing (website here) is supposedly a Python port of the popular Java ZXing library, but the initial and only commit is 6 years old and the project has no readme or documentation whatsoever. For the rest I found a couple qr-encoders (not decoders) and some API endpoints which can decode for you. Since I don't like this service to be dependent on other API endpoints I would want to keep the decoding local though. ![]() So to conclude; would anybody know how I can decode QR-codes from images in (preferable pure) Python? All tips are welcome!
Community♦
kramer65kramer65
3 AnswersYou can try the following steps and code using
Here is the complete code in a single run: Caveats
Community♦
mu 無mu 無
![]() The following code works fine with me: For QR code image creation: For QR code decoding: that prints the result:
YuiqYuiq
I spent nearly half an hour to make it work on Windows + Python 2.7 64-bit, so here are additional notes to the accepted answer:
and the code from the main answer should work:
BasjBasj
Not the answer you're looking for? Browse other questions tagged pythondecodeqr-codezxingzbar or ask your own question.
0 Comments
Leave a Reply. |