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

Add SQ code support #2

Merged
merged 6 commits into from
Feb 3, 2019
Merged

Add SQ code support #2

merged 6 commits into from
Feb 3, 2019

Conversation

jasp00
Copy link

@jasp00 jasp00 commented Feb 1, 2019

This patch adds support for SQ code, a simple 2D barcode.

@mchehab
Copy link
Owner

mchehab commented Feb 2, 2019

Thanks for the pull request.

The patches themself look good, although I was unable to test the SQ code parser.

A few comments:

  1. please add a description to each patch. That makes easier to identify what they're doing and helps a lot when looking at regressions, as it allows to identify why a certain change was needed;
  2. I'm adopting the practice of adding a certificate of origin of a patch, the same way as we use at Kernel trees (see https://linuxtv.org/wiki/index.php/Development:_Submitting_Patches#Developer.27s_Certificate_of_Origin_1.1).
    So, please add your SOB to the patches.
  3. While you're here adding a new 2D barcode, it would be cool if you could also update the helper message when a barcode is not found. currently, it displays:
- is the barcode type supported?  currently supported symbologies are:
  EAN/UPC (EAN-13, EAN-8, EAN-2, EAN-5, UPC-A, UPC-E,
  ISBN-10, ISBN-13), Code 128, Code 93, Code 39, Codabar,
  DataBar, DataBar Expanded, and Interleaved 2 of 5

(yeah, I know, it also doesn't mention QR... feel free to add it as well)

  1. are there any SQ code example that we could use to test the parser? On a quick search, I was unable to find one that identifies itself as SQ. If you can generate one (or find an image that it is compatible with Zbar license), it would be cool if it could be added into the examples/ directory. Otherwise, please provide us an hiperlink, in order to help testing it.

Javier Serrano Polo added 3 commits February 2, 2019 18:07
Add support for SQ code, a simple 2D barcode. zbarimg works with images
without noise elements. Language bindings have not been tested.

Signed-off-by: Javier Serrano Polo <javier@jasp.net>
SQ code assumes a square outline. Bad images may break this assumption and
cause out-of-bounds access. To fix this, add sanity checks.

Signed-off-by: Javier Serrano Polo <javier@jasp.net>
Building zbarcam-gtk fails because libzbar is missing from the command line.
Thus, add the missing library.

Signed-off-by: Javier Serrano Polo <javier@jasp.net>
Javier Serrano Polo added 3 commits February 2, 2019 19:21
Bad images trigger an integer type promotion bug in the SQ code decoder.
Thus, clarify what we want.

Signed-off-by: Javier Serrano Polo <javier@jasp.net>
zbarimg shows a warning when barcode is not detected. Print QR code and SQ
code in currently supported symbologies.

Signed-off-by: Javier Serrano Polo <javier@jasp.net>
This is a real-life example of SQ code. The two barcodes are equivalent. One
is generated by the encoder. The other is scanned from paper.

Signed-off-by: Javier Serrano Polo <javier@jasp.net>
@jasp00
Copy link
Author

jasp00 commented Feb 2, 2019

Done.

@mchehab mchehab merged commit fb453b3 into mchehab:master Feb 3, 2019
@mchehab
Copy link
Owner

mchehab commented Feb 5, 2019

See issue #8
There's something broken with SQ code. Trying to parse another barcode format causes it to loop forever.

While this is not solved, I'll disable sqcode from the default and add a warning.

@mchehab
Copy link
Owner

mchehab commented Feb 16, 2019

FYI, I got a hard to track bug with SQ code.

Please see:
6873d05

It is trigged when trying to read or set ZBAR_CFG_UNCERTAINTY for the SQ decoder. Only caught because zbarcam-qt now reads all configurations from all enabled decoders.

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.

2 participants