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

Fix invalid UPC-E in some cases #66

Merged
merged 2 commits into from
Jan 5, 2024
Merged

Fix invalid UPC-E in some cases #66

merged 2 commits into from
Jan 5, 2024

Conversation

shinbin
Copy link
Contributor

@shinbin shinbin commented Dec 20, 2023

Hi, DavBfr:
I found an issue in UPC-E barcode and fixed it.

One of the cases had a UPC-E input value of "100802" or "01008029".
The barcode content I expect to be displayed is "01008029" , as shown in the 1st picture,
but it displays '01020089' and cannot be read by the barcode scanner , as shown in the 2nd picture.
There are also errors in other input values, such as 107444,100902,100965,555555,1.. etc.

The issue comes from upcaToUpce() , whose RegExp cannot split groups accurately.
Please help to check and merge my fixed version.

Thanks.

OK, Test site : https://www.online-barcode.com/barcode-generator or https://barcodeqrcode.com/upc-e-generator/
upce_ok

NG, Test site : https://davbfr.github.io/dart_barcode/#/
upce_ng

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (7197206) 84.08% compared to head (7d1edd1) 84.04%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #66      +/-   ##
==========================================
- Coverage   84.08%   84.04%   -0.05%     
==========================================
  Files          32       32              
  Lines        2300     2294       -6     
==========================================
- Hits         1934     1928       -6     
  Misses        366      366              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@shinbin
Copy link
Contributor Author

shinbin commented Jan 5, 2024

@DavBfr
If you have time, please check out the pull request.
Thanks.

@DavBfr DavBfr merged commit 0be4a76 into DavBfr:master Jan 5, 2024
3 checks passed
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

Successfully merging this pull request may close these issues.

3 participants