CatimaLoyalty / Android

Catima, a Loyalty Card & Ticket Manager for Android
https://catima.app
GNU General Public License v3.0
871 stars 151 forks source link

My barcode scans and shows number, but displays the wrong format #44

Open TheLastProject opened 4 years ago

TheLastProject commented 4 years ago

Issue by myuseraccount Thursday May 30, 2019 at 18:11 GMT Originally opened as https://github.com/brarcher/loyalty-card-locker/issues/302


I have a library card that the camera scans successfully and captures the number, but the displayed barcode doesn't match the card. In fact, when I go to edit the entry, none of the displayed barcode options are correct. It seems that the scanning library supports other barcode formats than the ones in the list, but it just randomly guesses one when it doesn't actually support that one for display within the app. Took me awhile to figure out why it wouldn't scan off the screen.

How do I find out what format the barcode is, so I can request support for this type? IMG_20190530_103413

TheLastProject commented 4 years ago

Comment by myuseraccount Thursday May 30, 2019 at 18:20 GMT


Found a tool online that reads it: it says it's just Codabar, but neither this app nor another one I tried gives the correct bar output. I did get an error, from Skunk for Pebble: "Codabars must begin and end with A, B, C, or D!"

TheLastProject commented 4 years ago

Hmm, this is quite a weird issue. I see that the app does scan it successfully with the correct ID and as Codabar, but I see the barcode itself looks different...

fantasio31 commented 3 years ago

Hello,

Same issue on my side.

I put the original barcode from my provider (fidelity card in France), but computed barcode in app is different. The first 3 bars are not displayed.

index

QJKX commented 7 months ago

I tried a Codabar library card and it scans, but the code in Catima doesn't quite match visually - the stop code is missing.

To support accurate recreations of Codabar barcodes, Catima need to read and store the non-numeric ABCD characters in a Codabar code.

https://en.wikipedia.org/wiki/Codabar

Wikipedia says

The characters are divided into three groups, based on the number of wide elements:

The basic 12 symbols (digits 0–9, dash, and $) are encoded using all possible combinations of one wide bar and one wide space.
An additional 4 symbols (:/.+) are encoded using 3 wide bars and no wide spaces.
4 start and stop symbols (designated ABCD, or in some specifications, EN*T) are encoded using one wide bar and two wide spaces.

The wikipedia example barcode has a start and stop code like my card - confusingly it's not written in the number under the barcode, but the article mentions it starts with an A and ends with a B.

QJKX commented 7 months ago

https://github.com/zxing/zxing/issues/179#issuecomment-47840840

You can specify the hint DecodeHintType.RETURN_CODABAR_START_END to have them returned as part of the content.