ngx-scanner icon indicating copy to clipboard operation
ngx-scanner copied to clipboard

Different (wrong) codes scanned on multiple scan attempts

Open rodrigojrmartinez opened this issue 4 years ago • 1 comments

Describe the bug I'm using the zxing plugin on an angular application and I've noticed that for sometimes, I recieve different codes for the same barcode image, which is really strange.

For some reason some wrong code numbers are returned until I can get the proper code number for the barcode I'm scanning. I don't know if this has something to due with the formats supported or the camera itself.

To Reproduce Steps to reproduce the behavior:

  1. Go to https://barcode.tec-it.com/en/EAN13?data=5412301715555 and check the generated barcode image for the code number '541230175555' which has an EAN-13 format

  2. The formats supported are defined from a string array in my angular component which then is set as an input on the zxing scanner component as follows

Component:

public formatsList = [ 'CODABAR', 'CODE_39', 'CODE_93', 'CODE_128', 'DATA_MATRIX', 'EAN_8', 'EAN_13', 'QR_CODE' ];

HTML:

<zxing-scanner #scanner [formats]="formatsList" [device]="selectedCamera" (scanSuccess)="onScanSuccess($event)" (scanError)="onScanError($event)" (scanFailure)="onScanFailed($event)" (permissionResponse)="onHasPermission($event)" (camerasNotFound)="noCameraFound($event)"> </zxing-scanner>

  1. Scan it with the plugin repetedly and check the numbers returned, (there's no indication about the detected format along with the number, that would be a nice to have)

Expected behavior I would expect to always get the same barcode number for a particular barcode image despite its format

Video

ezgif-7-c82adddc0483

This happens mostly on browser. On a mobile phone is much better BUT it still every now and then retrieve a wrong barcode number

Desktop:

  • OS: windows
  • Browser: chrome
  • Version zxing: 3.0.0
  • Web Camera: Logitech 720p (not the best I'm afraid)

Smartphone:

  • Device: Xiaomi redmi 9
  • OS: Android 10
  • Browser: chrome (as PWA)
  • Version zxing: 3.0.0

I don't know if this is normal, or something that happened to others as well... any information is highly appreciated

rodrigojrmartinez avatar Apr 13 '21 16:04 rodrigojrmartinez

Sorry for the irrelevant qusetion. But can you share how you managed to expand the camera view to the entire screen? I'm currently trying to do the same thing but ng-deep video doesn't work.

harrispap03 avatar May 21 '21 07:05 harrispap03