Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Diferents values of codeResult.code for the same object #24

Open
mpvalente24 opened this issue Feb 20, 2020 · 6 comments
Open

Diferents values of codeResult.code for the same object #24

mpvalente24 opened this issue Feb 20, 2020 · 6 comments

Comments

@mpvalente24
Copy link

Right now, i am reading a lot of values, but sometimes, they are diferents for the same material.

component.ts:
...
onValueChanges(result) {
console.log(result);
this.barcodeValue = result.codeResult.code;
}
...
component.html
...

...

There is some explanation for that to happen?

@julienboulay
Copy link
Owner

Hi @mpvalente24,

Yes, some error can happen when reading the same barcode.
There is currently no way to verify the validity of the scan.
If you can compare with a barcode database, then you can know if this barcode is right.

Possible improvement : currently, the first result is taken. By getting multiple scan results (for example 10 simultaneous scans), we could check what's the most relevant value.

@dharmesh-parekh
Copy link

dharmesh-parekh commented Dec 3, 2020

Hi @julienboulay

I am facing the same issue. I am getting different scan results every time when I scan for the same barcode. Compare each result with database every time to verify barcode is not proper way for the same barcode.

Can you please help me to resolve this issue?

Thanks.

@julienboulay
Copy link
Owner

julienboulay commented Dec 9, 2020

Hi @dharmesh-parekh,

To ensure that your barcode is not analyzed in the wrong format, first verify that you limit barcode recognition to the type of barcode you want to handle.
For example, a code 128 might be analyzed as ean 8 and then give you wrong result.
In this case, set [type]="['code_128']" on you component

@julienboulay
Copy link
Owner

@dharmesh-parekh
Another way to limit false positive is to check decodedCodes.error and implement a sanityCheck to ensure the value matched the expected regexp.
See serratus/quaggaJS#237

@julienboulay
Copy link
Owner

I will try to provide a default implementation in the near futur

@RichardTezbirr
Copy link

Hi, was this issue resolved ? Or is somebody still working at this package ?

I saw https://stackblitz.com/edit/ngx-barcode-scanner-demo?file=src%2Fapp%2Fapp.component.html , which is new package, unfortunately unable to install as dependency to any project.

But trying live demo, it seems to work very fast compare to this package used by much more people.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants