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

[FEATURE] let me choose how to display the code: QR or Barcode #49

Closed
Zoldex opened this issue Jan 10, 2025 · 8 comments
Closed

[FEATURE] let me choose how to display the code: QR or Barcode #49

Zoldex opened this issue Jan 10, 2025 · 8 comments
Assignees

Comments

@Zoldex
Copy link

Zoldex commented Jan 10, 2025

Is your feature request related to a problem? Please describe.
My gift cards all use barcodes, but when I scan or manually enter the code, VoucherVault only generates a QR code. This makes the app unusable for me.

Describe the solution you'd like
If I scan a barcode, I would like to have a barcode. If I input a code number, at least, let me select how the code should be displayed

Describe alternatives you've considered
I can't see any alternative

Additional context
Introduce the ability to switch between viewing as a QR code or a barcode: My gift cards all use barcodes, but when I scan or manually enter the code, VoucherVault only generates a QR code. This makes the app unusable for me.

@l4rm4nd
Copy link
Owner

l4rm4nd commented Jan 10, 2025

VoucherVault currently only supports EAN13 bar codes.

If it's not an EAN13 bar code, the fallback will be a QR code. There is no option to select the type, as such bar codes have check digits. So we can actually validate whether a code is a valid EAN13 bar code or not. Otherwise, you may select EAN13 but it's not working later when being scanned.

Maybe you are in a country that uses a different type of bar codes. Could you check?

@l4rm4nd
Copy link
Owner

l4rm4nd commented Jan 10, 2025

You can validate your barcode and test whether it's EAN13 or not.

https://eancheck.com/

@Zoldex
Copy link
Author

Zoldex commented Jan 10, 2025

my code is 010800426375303321006486066332 (it's expired so ok to show).
Google wallet shows a barcode. Catima also show as barcode and display it as Code 128.
Most of gift cards I own have far more than 13 chars and are barcodes.

@l4rm4nd
Copy link
Owner

l4rm4nd commented Jan 10, 2025

010800426375303321006486066332

Alright. That's not an international EAN13 barcode.

So currently not supported.

However, the library I am using supports all type of barcodes. Will think about it and tinker. As you can imagine, supporting all bar codes can be tricky, as every type must be validated. Otherwise, users may choose a type that will not work later on.

@Zoldex
Copy link
Author

Zoldex commented Jan 10, 2025

I can understand in case user types (or paste) the code, but when scanned aren't you able to find the right type?

@l4rm4nd
Copy link
Owner

l4rm4nd commented Jan 10, 2025

I can understand in case user types (or paste) the code, but when scanned aren't you able to find the right type?

Does not matter whether typed in or scanned.

To be fair, typed in is easier than during image scanning.

In the end, the obtained input must be validated against a set of barcode types. Also includes calculating check codes etc.

Not that straigt-forward but have to research and tinker with the barcode library a bit.

  • For camera input scanning, I am using the library https://github.com/zxing-js/library. Supports a handful of 1D/2D code types.
  • For QR or bar code image generation, I am using Python treepoem==3.24.0. Supports nearly all code types.

@l4rm4nd
Copy link
Owner

l4rm4nd commented Jan 10, 2025

Hey @Zoldex

a new release v1.9.x is currently building.

This release supports additional barcode types. Camera scanning should detect the type and auto-select the type. For your provided barcode, it should typically select code128.

Feel free to try and report whether this fixes your issues.

Supported code types

@burgerga
Copy link

Wow, this is amazing, this was in the back of my head because I had some Type 39s, and then when I open the github again I see it's already fixed. Thanks for your ultra-fast responses :)

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

No branches or pull requests

3 participants