Open CRonaldo1997 opened 6 years ago
Were you able to solve this?
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!