You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

14 lines
405 B

import sys, zxingcpp
from PIL import Image
img = Image.open(sys.argv[1])
barcodes = zxingcpp.read_barcodes(img)
for barcode in barcodes:
print('Found barcode:'
f'\n Text: "{barcode.text}"'
f'\n Format: {barcode.format}'
f'\n Content: {barcode.content_type}'
f'\n Position: {barcode.position}'
f'\n Extra: {barcode.extra}')
if len(barcodes) == 0:
print("Could not find any barcode.")