brarcher / loyalty-card-locker

Stores your barcode-based store/loyalty cards on your phone
GNU General Public License v3.0
172 stars 29 forks source link

Couldn't scan at store with dark theme #328

Closed TheLastProject closed 4 years ago

TheLastProject commented 4 years ago

Just so I don't forget to test this again. Local grocery store, barcode type EAN_13. Code scans fine on light theme.

brarcher commented 4 years ago

Can you clarify what you found when using the dark theme to scan a barcode at the store? Did you find an issue with 2D barcodes? I see that change #329 adds more white space around all barcodes, effectively making the rendered barcodes smaller and adding more quiet space. Perhaps the Zxing library is not leaving enough quiet space around 2D barcodes?

TheLastProject commented 4 years ago

Well, I only have one store where I could test, which used an EAN_13 barcode, thus I have no clue if it affects other barcode types at all.

While at the store, it took me a lot of effort to attempt to scan the barcode (and I didn't succeed) but the moment I switched to the light theme it scanned instantly. My idea was indeed that there was not enough "quiet space" (if I look at the physical loyalty card, the card is mostly blue but there is a white border around the barcode similar to what my patch adds). Scanning the barcode after adding the quiet space in this patch did make it scan instantly even on the dark theme.

So, I know that at least for the EAN_13 barcode this fixes some scanners not picking it up properly, but I indeed do not know the effect it would have on other barcodes, but I would assume they would likely have the same issue.

brarcher commented 4 years ago

One other thing that may be worth checking is that this app uses ZXing 3.3.0, and 3.4.0 is now available. Maybe there is an improvement in 3.4.0 that helps. zxing-android-embedded also has an update available.

TheLastProject commented 4 years ago

I just updated both zxing and xzing-android-embedded to the latest version locally to try and that made no difference.

TheLastProject commented 4 years ago

I actually managed to successfully scan with dark mode without this patch several times now. I guess I just had bad luck that one time. Closing this issue.

TheLastProject commented 4 years ago

Had to again switch to the light theme. I think one of the scanners at the local grocery store is having more trouble than the others. This should probably be fixed by #329 anyway

TheLastProject commented 4 years ago

I would strongly suggest merging #329 in before releasing to Google Play as it can't cause harm but will likely improve the scanning situation in the dark theme a lot (I never had issues with the patch applied and only ever without it).