zxing-js / library

Multi-format 1D/2D barcode image processing library, usable in JavaScript ecosystem.

Home Page:https://zxing-js.github.io/library/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to scan the UPC-E

Oktay28 opened this issue · comments

commented

Describe the bug
The scanner can't find the UPC-E barcode. It works with the rest of the formats that are set, but not with UPC_E. Tried on multiple devices, non of them succeeded

 const hints = new Map()
 const formats = [
       BarcodeFormat.UPC_A,
       BarcodeFormat.UPC_E,
       BarcodeFormat.UPC_EAN_EXTENSION,
 ]

 hints.set(DecodeHintType.POSSIBLE_FORMATS, formats)

 const scanner = new BrowserMultiFormatReader(hints)
 const stream = await navigator.mediaDevices.getUserMedia({ video: { facingMode: 'environment' }})
 const result = await scanner.decodeOnceFromStream(stream, 'video').catch(() => null)

Screenshots
This is what I am trying to scan
upc_e2

Additional context
Library version 0.20.0

Confirmed, couldn't scan any UPC-E barcodes, not just the above barcode, but others I made with different methods.

The code in the screenshot can be scanned with a Zebra TC52 Android device.

When I copy the screenshot into a paint program and zoom in, it is obvious it is antialiased, not a good thing to do with barcodes.

image

This is better:

image

Stale issue message