2

QTQR do not show bar codes anymore, no matter whether input is read from file or webcam in 16.04. It used to work just fine in 15.x, 14.x, ... It still Generates QR codes just fine, and in contacts the date is now only included if the checkbox is checked (great) ![enter image description here]1 Dropping Qr-codes on the right does not work either! When trying from cli I get this when opening (or not) a file:

ken@ken-Latitude-E6510:~/Pictures/Barcods$ qtqr Traceback (most recent call last): File "/usr/bin/qtqr", line 540, in decodeFile if qr.decode(): File "/usr/lib/python2.7/dist-packages/qrtools.py", line 181, in decode raw = pil.tostring() File "/usr/lib/python2.7/dist-packages/PIL/Image.py", line 695, in tostring "Please call tobytes() instead.") Exception: tostring() has been removed. Please call tobytes() instead.

So it must be an error!

  • How did you verify that the webcam works? – Karl Richter Jun 7 '16 at 10:30
  • @ Karl Richter easy press decode chose webcam - chose your webcam from the list - webcam turns on Window pops up with the picture, so you see yourself trying to impose the barcode from paper ! - hold barcode in front ! And nothing happens !! – Ken Mollerup Jun 7 '16 at 10:39
  • I installed zbar-tools and it reads fine, both cam and file, I made the error of thinking qtqr used zbar ! But it still dosn't work!! It looks to be a function or library update problem in the code! – Ken Mollerup Jun 7 '16 at 12:45
0

The terminal output

/usr/lib/python2.7/dist-packages/PIL/Image.py:870: UserWarning: Palette images with Transparency   expressed in bytes should be converted to RGBA images
  'to RGBA images')
Traceback (most recent call last):
  File "/usr/bin/qtqr", line 540, in decodeFile
    if qr.decode():
  File "/usr/lib/python2.7/dist-packages/qrtools.py", line 181, in decode
    raw = pil.tostring()
  File "/usr/lib/python2.7/dist-packages/PIL/Image.py", line 695, in tostring
    "Please call tobytes() instead.")
Exception: tostring() has been removed. Please call tobytes() instead.
Traceback (most recent call last):
  File "/usr/bin/qtqr", line 540, in decodeFile
    if qr.decode():
  File "/usr/lib/python2.7/dist-packages/qrtools.py", line 181, in decode
    raw = pil.tostring()
  File "/usr/lib/python2.7/dist-packages/PIL/Image.py", line 695, in tostring
    "Please call tobytes() instead.")
Exception: tostring() has been removed. Please call tobytes() instead.

indicates a bug which I filed at https://bugs.launchpad.net/ubuntu/+source/qr-tools/+bug/1589965. You can only sit and wait until it's fixed (or fix it yourself and share, of course).

1

While we wait for a fix, we can do as the error output and Karl Ricsays says: open with sudo: /usr/lib/python2.7/dist-packages/qrtools.py

Locate line 181: raw = pil.tostring()

Change it to: raw = pil.tobytes()

Save the python script and start QtQR.

Now it works![enter image description here]1

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.