Giter VIP home page Giter VIP logo

qrtools's People

Contributors

primetang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

qrtools's Issues

Cannot find 'QR' from 'qrtools'

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.

Why not import image from pillow by default.

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?

Problem in creating MECARD

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')];")

Using deprecated Pillow method tostring()

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

Decoding error on a QR code

Hello,

This QR code appears to be wrongfully decoded by qrtools:
test

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.

Segmentation fault

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?

qrtools don't decode a router wifi code

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.