zxing-js / library

Multi-format 1D/2D barcode image processing library, usable in JavaScript ecosystem.
https://zxing-js.github.io/library/
Apache License 2.0
2.36k stars 535 forks source link

Unable to scan the UPC-E #576

Open Oktay28 opened 10 months ago

Oktay28 commented 10 months ago

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

teckel12 commented 9 months ago

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

rob313663 commented 9 months ago

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

rob313663 commented 9 months ago

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
github-actions[bot] commented 2 months ago

Stale issue message