journeyapps / zxing-android-embedded

Barcode scanner library for Android, based on the ZXing decoder
https://journeyapps.com/
Apache License 2.0
5.76k stars 1.27k forks source link

I can't scan a barcode on a pack of cigarettes #543

Open ola-skorp opened 4 years ago

ola-skorp commented 4 years ago

implementation('com.journeyapps:zxing-android-embedded:4.1.0') { transitive = false } implementation 'com.google.zxing:core:3.3.0'

Here is the barcode I can't scan https://ibb.co/9ZYGvp8 This app can't scan it too https://play.google.com/store/apps/details?id=com.google.zxing.client.android&hl=en

How can I scan this barcode?

rkistner commented 4 years ago

Duplicate of #485.

This appears to be a weird form of datamatrix:

  1. It's inverted (white on black instead of black on white).
  2. The individual blocks are round instead of square.

You can work around the first issue by inverting the image before scanning (see #485), but not sure if you can do anything about the second issue.

ola-skorp commented 4 years ago

Thank you, but I need to scan in real time and I even don't know what barcode a user wants to scan therefore I can't invert the image I need to invert

rkistner commented 4 years ago

There is an option for a "mixed" mode - see this sample: https://github.com/journeyapps/zxing-android-embedded/blob/e48229ac3f47318e4b5516c645147d7dea37dc28/sample/src/main/java/example/zxing/MainActivity.java#L42

The mixed mode alternates between scanning the normal image and inverted image, meaning that scanning barcodes may be slower, but will cover both normal and inverted ones.

nyxiscoo1 commented 4 years ago

ZXing doesn’t support DataMatrix DPM(Direct Part Marking, Dot Peer Marking) barcodes. Mixed/inverted mode makes no difference.