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!

Ken Mollerup
  • 1,265
  • 1
  • 11
  • 22
  • How did you verify that the webcam works? – Kalle Richter Jun 07 '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 07 '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 07 '16 at 12:45

2 Answers2

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

Ken Mollerup
  • 1,265
  • 1
  • 11
  • 22
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).

Kalle Richter
  • 5,935
  • 20
  • 69
  • 101