Only QR-codes can be scanned. Not e.g EAN13.
See original GitHub issueThe scanner in my app can’t recognize any barcodes - except for QR codes. I have tried to configure the ZXingScannerComponent to enable EAN13 Barcodes:
//TS file
formatsEnabled: BarcodeFormat[] = [BarcodeFormat.EAN_13];
//template
<zxing-scanner
#scanner
[torch]="torchEnabled"
[(device)]="currentDevice"
(scanSuccess)="onCodeResult($event)"
[formats]="formatsEnabled"
...
And I can confirm this configuration by logging the formats in the AfterViewInit method:
@ViewChild('scanner') scanner: ZXingScannerComponent;
ngAfterViewInit(): void {
console.log(this.scanner.formats); //prints only 7, which is EAN_13
}
However, the scanner still doesn’t recognize EAN_13 barcodes but does still recognize QR-codes even though QR codes are not enabled. I have also tried to enable almost all barcode types, but still, the scanner will only recognize QR-codes. 😕
I am using the following versions:
"@zxing/ngx-scanner": "^3.0.0" and "@angular/core": "~9.1.4",
Any thoughts on what might be wrong here?
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (4 by maintainers)
Top Results From Across the Web
Guide to Barcodes vs. QR Codes: Analysis and Comparison
Both QR codes and barcodes store information about an item or product in a machine-readable format that can be easily scanned with a...
Read more >How to choose the right barcode type for your application
Will barcodes be scanned with smartphones? Sometimes? Smartphone scanners vary, but many phones can read UPC-A, EAN 13, Code 128, Code 39, QR...
Read more >iOS 16 - Scanning barcode | Apple Developer Forums
Our app doesn't scan barcode correctly, only QRCode are recognized. For example EAN13 are not detected by the "AVCaptureMetadataOutput".
Read more >Strange happened when Scanning EAN13 Barcode by using ...
then there is a problem to read the barcode, but these barcodes are a valid ean13 barcode, and it can be read easily...
Read more >EAN 13 Barcode Explained
Barcode fonts are a quick and easy way to create barcodes - provided the barcode is not too complicated, a good example would...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We got it working by having the zxing-scanner component as a viewchild. It is not super pretty but maybe that will also work for you…:
TEMPLATE: <zxing-scanner #scanner … …
COMPONENT:
The solution above worked fine, but made the performance decrease. Is it possible to set on the lib all the formats as default in order to mitigate this bug?