zplab / zbar-py

Simple python 2 and 3 compatible interface to the zbar barcode-reading library
MIT License
82 stars 30 forks source link

Come across a corner case when decoding image cause core dump #19

Open zwsjink opened 12 months ago

zwsjink commented 12 months ago

The error shows like this :

python3: /build/zbar-m079fX/zbar-0.10+doc/zbar/qrcode/qrdectxt.c:368: qr_code_data_list_extract_text: Assertion `next > syms->datalen' failed. Aborted (core dumped)

when I'm doing experiment with a bunch of pictures, some case failed constantly: corner_case

The code goes like this:

from PIL import Image
from pyzbar.pyzbar import decode
image = Image.open(image_path)
image = image.convert('L')
qr_codes = decode(image)
print(len(qr_codes))