QTQR 不再显示条形码,无论输入是从文件还是从网络摄像头读取。它在 15.x、14.x 中工作正常……它仍然可以正常生成二维码,并且在联系人中,现在只有在选中复选框时才会包含日期(很棒) ]1 在右侧放置二维码也不起作用!当我从 CLI 尝试打开(或不打开)文件时,我得到以下信息:
ken@ken-Latitude-E6510:~/Pictures/Barcods$ qtqr Traceback(最近一次调用):文件“/usr/bin/qtqr”,第 540 行,在解码文件中 if qr.decode():文件“/usr/lib/python2.7/dist-packages/qrtools.py”,第 181 行,在解码文件中 raw = pil.tostring() 文件“/usr/lib/python2.7/dist-packages/PIL/Image.py”,第 695 行,在 tostring 文件中“请改为调用 tobytes()。”)异常:tostring() 已被删除。请改为调用 tobytes()。
所以这肯定是一个错误!
答案1
在等待修复的同时,我们可以按照错误输出进行操作,Karl Ricsays 说:使用 sudo 打开:/usr/lib/python2.7/dist-packages/qrtools.py
找到第 181 行:raw = pil.tostring()
更改为:raw = pil.tobytes()
保存python脚本并启动QtQR。
现在它起作用了]1
答案2
终端输出
/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.
表示我提交了一个错误https://bugs.launchpad.net/ubuntu/+source/qr-tools/+bug/1589965。你只能坐着等它修好(或者当然,自己修好然后分享)。