width, height = img.size
stream = zbar.Image(width, height, 'Y800', img.tostring())
scanner.scan(stream)
for symbol in stream:
    pass
How to get type of Encoding Style of QR/bar-code with python-qrtools/ZBar?