Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding extra 0's to UPC-E barcode (8 digit barcodes to match length of 12 digits). #160

Open
FDUS105301 opened this issue Jan 4, 2024 · 0 comments

Comments

@FDUS105301
Copy link

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"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant