8000 QR code image coule not be decode · Issue #13 · Polyconseil/zbarlight · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
QR code image coule not be decode #13
Open
@mengyyy

Description

@mengyyy

System:
Ubuntu 16.04.3 LTS
Python:
Python 3.5.2
zbarlight==1.2
Pillow==4.2.1
lib:
libzbar-dev/xenial,now 0.10+doc-10ubuntu1 amd64 [installed]
libzbar0/xenial,now 0.10+doc-10ubuntu1 amd64 [installed]

First:
I meet a strange image coule not be decoded.
But i use telegram to send this image ,and use my bot to get it .It convert to jpeg by the telegram client and it could be decode success.
So I try to convert the raw png to jpeg by image.convert('RGB'), but this jpeg image fail decode .

The raw png image file: (failed decode)
qr_code_for_mobile_english_wikipedia svg
Convert by telegram Android client jpg file:(success decode)
photo_2017-08-09_14-25-22

Second:
I also found a image decode failed without any process, but after i use image.thumbnail() it could be decode success.
qrcode

Part of my code:

remote_image = requests.get(url)
image_file = io.BytesIO(remote_image.content)
image = Image.open(image_file)
image.load()
zbarlight.scan_codes('qrcode', image)
image.thumbnail((int(image.size[0]/8), int(image.size[1]/8)))
zbarlight.scan_codes('qrcode', image)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0