Barcode starting with 0 not detected when EAN13 and UPC A are both enabled
jneuhaus20 opened this issue · comments
I have a barcode starting with '0' that is either EAN13 or UPC A (honestly not sure which one it "really" is, just that it's ambiguous according to the readers.) When EAN13 and UPC_A are both enabled, no barcode is detected.
I tracked it down to the conversion functionality here:
library/src/core/oned/MultiFormatUPCEANReader.ts
Lines 97 to 109 in b88907c
The problem is that UPCEANReader
doesn't actually set the raw bytes, so rawBytes
is set to null
at line 98, and the accessor on 103 throws an error, which is caught higher up and converted into NotFoundException
.
I tried to fork the demo's StackBlitz for this as the current one is out of date, but there's an unrelated ES5/ES6 issue going on across the packages.
I created PR #456 for this already.
I scan UPC-A Barcode i.e 725272730706 and its detecting EAN_13 with a leading 0 in this barcode i.e 0725272730706
Yeah, the graphical encoding (bars) are literally that (see this great explanation on the two). Basically, US and Canada just don't write the leading 0 under the bars, for historical reasons that are stupid.