Skip to content

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

@FDUS105301

Description

@FDUS105301

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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions