primetang / qrtools Goto Github PK
View Code? Open in Web Editor NEWA suite of tools for handling QR codes.
License: GNU General Public License v3.0
A suite of tools for handling QR codes.
License: GNU General Public License v3.0
Just a message for those that are having trouble with from qrtools import QR
or import qrtools; qrtools.QR()
I am using windows (py 3.5.0) and I got it to work by using:
from qrtools.qrtools import QR
As opposed to what the installation docs say.
Also; there seems to be a problem with the package 'zbar' as I cannot install it on my Windows machine but that's a problem with the zbar package.
nowadays the function "decode" only with param of filename,
Please consider overload the decode function with the param of raw buff.
It looks like zbar is a dependency of this project but I can't seem to pip install zbar
with python version 3.8.5.
There are a lot of posts suggesting you cannot use zbar with Python 3. Is it possible to change dependencies so that qrtools can work with Python 3?
I was trying to get this library and its dependencies running on windows (unfortunately I had no choice) and I had to modify qrtools.py so that it imported from pillow by default.
Originally:
try:
import Image
except:
from PIL import Image
Changed To:
try:
from PIL import Image
except:
import Image
I had to do this because although "Image" could be imported without error it did not function as expected and caused qrtools to throw error when used. The image sub module of pillow, however, works perfectly. What is the reason for only using pillow as a fall back? Why not make pillow the default?
I am having a problem in creating 'MECARD' due to a lack of proper docs so can you please share a simple code snippet on how to make it.
Thank You
I am trying like this but unable to do it.
qr.add_data("MECARD: [('N','Tazim'),('tel','6206430455')];")
Got this problem when trying to use qrtools with up-to-date Pillow package (http://python-pillow.github.io/)
Traceback:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python2.7/dist-packages/qrtools.py:181: in decode
raw = pil.tostring()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <PIL.Image.Image image mode=L size=128x128 at 0x7F1FAF783ED0>, args = ()
kw = {}
def tostring(self, *args, **kw):
raise Exception("tostring() has been removed. " +
> "Please call tobytes() instead.")
E Exception: tostring() has been removed. Please call tobytes() instead.
Here's PIL function definition: https://github.com/python-pillow/Pillow/blob/master/PIL/Image.py#L698
Here's my Pillow version:
$ pip show pillow
---
Metadata-Version: 2.0
Name: Pillow
Version: 3.1.1
Summary: Python Imaging Library (Fork)
Home-page: http://python-pillow.github.io/
Author: Alex Clark (Fork Author)
Author-email: [email protected]
Installer: pip
License: Standard PIL License
Location: /usr/local/lib/python2.7/dist-packages
It works with Pillow v.2.9.0
Hello,
This QR code appears to be wrongfully decoded by qrtools:
It contains the url "https://qrwm.org/Q34189?pk_campaign=transdev&pk_kwd=Q209101", but qrtools wrongfully decodes it as the text "41" :
import qrtools
qr = qrtools.QR()
qr.decode("test.png")
print(qr.data)
print(qr.data_type)
print(qr.data_to_string())
returns
41
text
b'\xef\xbb\xbf41'
Context: I have generated ~500 similar QR codes through https://qrwm.org for being printed and displayed on bus stops and so I made a small script using qrtools and a regex to check if everything is ok. This is the only one that returns an error. At first I thought I did something wrong with this particular QR code, but if I scan it with my phone or an online decoder like https://zxing.org/, it returns the URL, so I think the problem is with this library.
I installed and run the example as instructed on your Read me file; it gives "Segmentation fault" for any simple QR code png file. What do you suggest?
Traceback (most recent call last):
File "/usr/bin/qtqr", line 837, in decodeWebcam
if qr.data_decode[qr.data_type](qr.data) == 'NULL':
File "/usr/lib/python3.9/site-packages/qrtools.py", line 110, in <lambda>
'wifi' : lambda data: re.findall(u"WIFI:S:(.*);T:(.*);P:(.*);[H:]+(.*);", data, re.IGNORECASE)[0],
IndexError: list index out of range
This bug keeps qtqr failing when scanning WIFI qr codes generated by FritzBox. Attached a PNG of the failing QR Code. Its content is:
WIFI:S:WifiName;T:WPA;P:605234075537023465159873240561365314585632096534;;
$ qtqr --version
QtQR version 2.0
$ zbarcam --version
0.23.1
Looks to, as if "[H:]+(.)" may be empty (missing "H:"), but regEx does not match in that case. Changing "[H:]+(.)" to "[H:](.)" helped in my case, Will create a pull request on GitHub :)
Originally reported here: https://bugs.launchpad.net/qr-tools/+bug/1810167
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.