You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As described in the README, reader.decode() takes image path as parameter:
reader = zxing.BarCodeReader("/var/opt/zxing")
barcode = reader.decode("/tmp/image.jpg")
How to take bytes instead of image path? For example:
with open('/tmp/image.jpg','rb') as img_file:
img_bytes = img_file.read()
barcode = reader.decode(img_bytes)
Thanks!
The text was updated successfully, but these errors were encountered:
I don't think it's possible. Take a look at the code and you'll find it just calls zxing package from the command line. You will have to write the stream into a temporary file first.
As described in the README, reader.decode() takes image path as parameter:
reader = zxing.BarCodeReader("/var/opt/zxing")
barcode = reader.decode("/tmp/image.jpg")
How to take bytes instead of image path? For example:
with open('/tmp/image.jpg','rb') as img_file:
img_bytes = img_file.read()
barcode = reader.decode(img_bytes)
Thanks!
The text was updated successfully, but these errors were encountered: