On scanning UPC-E type barcodes which consist of 8 digits, the result is being changed to match a 12 digit barcode by adding 0's in the middle of the barcode.
For example:
on scanning 06541238 the barcode reader will return 065400001238.
This behavior, to my knowledge, cannot be changed.
Pyzbar version: 0.1.9
Python version: 3.9.0
Code:
def init_scan(image_path):
#Fallback for opencv scan failure
try:
image = cv2.imread(image_path)
decoded = pyzbar.decode(image)
if decoded != []:
return {'success':True, 'data':decoded[0].data}
else:
return {'success':False, 'data':''}
except:
return "Error"