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

feat: Allow scanning more GS1 barcodes #8911

Closed
wants to merge 13 commits into from
Closed

Conversation

hangy
Copy link
Member

@hangy hangy commented Aug 26, 2023

What

Use the official GS1 parser library to extract more types of barcodes from images, as to support the GS1 "Sunrise 2027" initiative.

Related issue(s) and discussion

@codecov-commenter
Copy link

codecov-commenter commented Aug 26, 2023

Codecov Report

Merging #8911 (a7f80cb) into main (c58b690) will increase coverage by 0.23%.
Report is 13 commits behind head on main.
The diff coverage is 73.58%.

@@            Coverage Diff             @@
##             main    #8911      +/-   ##
==========================================
+ Coverage   46.09%   46.32%   +0.23%     
==========================================
  Files          64       64              
  Lines       19837    19897      +60     
  Branches     4801     4810       +9     
==========================================
+ Hits         9143     9217      +74     
+ Misses       9513     9501      -12     
+ Partials     1181     1179       -2     
Files Changed Coverage Δ
lib/ProductOpener/Images.pm 17.31% <65.38%> (+4.58%) ⬆️
lib/ProductOpener/Products.pm 48.05% <81.48%> (+0.82%) ⬆️

... and 5 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@hangy
Copy link
Member Author

hangy commented Aug 26, 2023

Currently missing: Barcode::ZBar doesn't understand DataMatrix codes, and there doesn't seem to be a Perl package that does. Might be worth to create a wrapper around zxing-cpp, or so.

@teolemon teolemon added the GS1 The producer platform is integrating with the GS1 product data formats. GS1 manages barcodes. label Aug 28, 2023
@teolemon
Copy link
Member

@hangy We're having the Product Opener call in 20 minutes if you'd like to present the PR >>> https://meet.google.com/nnw-qswu-hza

Dockerfile Outdated Show resolved Hide resolved
@github-actions github-actions bot added the ⭐ top pull request Top pull request. label Aug 29, 2023
@hangy hangy force-pushed the issue/8333-gs1-sunrise-2027 branch from 7ba9537 to fdb84b7 Compare August 29, 2023 21:00
@hangy hangy linked an issue Aug 29, 2023 that may be closed by this pull request
@hangy hangy marked this pull request as ready for review August 30, 2023 21:48
@hangy hangy requested a review from a team as a code owner August 30, 2023 21:48
- Remove redundant `$`
- Fix scope of `$ai_data_str`
- Some regexes
- libzxing-dev requires a the current Debian stable, bookworm.
- libapache2-request-perl is only available via backports for bookworm.
test: Add first unittest for GS1 DataMatrix code

Thanks to @tonycoz (TONYC on cpan) for implementing Imager::zxing!
- Ensure that more GS1 Data Link URI formats can be 'normalized'
- URIs that cannot be a GS1 Data Link should not be treated as an
  product code
@hangy hangy force-pushed the issue/8333-gs1-sunrise-2027 branch 2 times, most recently from fc27db2 to 074b1cc Compare September 12, 2023 19:46
@hangy hangy force-pushed the issue/8333-gs1-sunrise-2027 branch from 074b1cc to 16ebb60 Compare September 12, 2023 21:00
hangy added a commit that referenced this pull request Sep 12, 2023
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

hangy added a commit that referenced this pull request Sep 21, 2023
@github-actions github-actions bot added the 💥 Merge Conflicts 💥 Merge Conflicts label Sep 21, 2023
@hangy hangy closed this Sep 28, 2023
@hangy hangy deleted the issue/8333-gs1-sunrise-2027 branch September 28, 2023 16:30
hangy added a commit that referenced this pull request Nov 29, 2023
* chg: Support GS1 barcodes for code normalization

* fix: Minor mistakes

- Remove redundant `$`
- Fix scope of `$ai_data_str`
- Some regexes

* fix: perl tidy and critic

* test: Add additional test for normalization

* chg: Catch GS1::SyntaxEngine exceptions

* test: Some more cases

* fix: Don't try to normalize undef code

* test: Add additional tests for `normalize_code`

- Ensure that more GS1 Data Link URI formats can be 'normalized'
- URIs that cannot be a GS1 Data Link should not be treated as an
  product code

* docs: Update POD for `normalize_code()`

* fix: URI and URL should both be valid in code

* test: Add some image test

[WIP]

* test: Some more cases

* deps(cpan): Add Imager::zxing to support DataMatrix barcodes

- libzxing-dev requires a the current Debian stable, bookworm.
- libapache2-request-perl is only available via backports for bookworm.

* feat: Use Imager::zxing to decode DataMatrix codes

test: Add first unittest for GS1 DataMatrix code

Thanks to @tonycoz (TONYC on cpan) for implementing Imager::zxing!

* test: Add tests for GS1 Data URI with QR Code and DataMatrix

* test: Add tests for some GS1 DataBar variants

* deps: Revert to debian bullseye, and install zxing-cpp 2.1.0 manually

See #8911 (comment) for discussion

* style: Fix indentation

---------

Co-authored-by: Alex Garel <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
barcodes GS1 The producer platform is integrating with the GS1 product data formats. GS1 manages barcodes. 🖼️ Images 💥 Merge Conflicts 💥 Merge Conflicts Products ⭐ top pull request Top pull request. 🧪 tests 🧪 unit tests
Projects
Development

Successfully merging this pull request may close these issues.

Update barcode recognition to understand more barcode types
6 participants