library icon indicating copy to clipboard operation
library copied to clipboard

[CODE_128] Can't read barcode

Open jumafuse opened this issue 1 year ago • 11 comments

Any help would be greatly appreciated.

My code basically replicates the behaviour of the test application:

https://zxing-js.github.io/library/examples/multi-camera/

Example Image:

https://ibb.co/hWkGHzm

I can hardly read it in a blue moon under perfect conditions. It really doesn't make sense since most of the time doesn't work.

If I'm missing some configuration options that I should set somewhere, I set hints already to only CODE_128.

I would greatly appreciate any hints.

jumafuse avatar Jun 23 '23 11:06 jumafuse

I can offer a bounty if that helps any time dedicated to this worthwhile.

jumafuse avatar Jun 27 '23 13:06 jumafuse

i'm having the same issue 😞 but with EAN codes. If i find something i'll let you know

alvarobertin avatar Jul 04 '23 21:07 alvarobertin

i'm having the same issue 😞 but with Codebarcodes. If i find something i'll let you know

zhanghaipeng788 avatar Jul 10 '23 06:07 zhanghaipeng788

In my case it is working with version 0.19.x but not with latest 0.20.0.

bbuhler avatar Jul 11 '23 12:07 bbuhler

@jumafuse It could be you're using the wrong camera on your scanning device (if using a phone). it could be using a camera that doesn't support autofocus.

I forked a Vue-based library and added the capability to auto-select the most appropriate camera (back camera with autofocus and torch). I also added a bunch of other features which greatly help scanning (like zoom and even manual focus capability). Basically, the goal was for it to work as well as any native barcode scanning app. BTW, my library can totally read your example barcode without any issues.

Here's a link to a demo. Probably best to try it from your phone:

https://barcode.leethost.com/

teckel12 avatar Jul 30 '23 21:07 teckel12

Wow @teckel12, its working perfectly! That's what we were looking for in my team!

Kudos to you!

alvarobertin avatar Jul 31 '23 17:07 alvarobertin

@jumafuse Try using version 0.18.0 (I think 0.18.2 is the last one that works properly). I've pinned that version in my project as 0.18.3 broke scanning of several symbologies including EAN13 and CODE_128. Issues with EANs have been resolved in 0.20.0, but when I compared 0.20.0 and 0.18.0 side by side the former simply couldn't scan CODE_128 reliably while the latter fared much better.

JanPolasek avatar Aug 27 '23 20:08 JanPolasek

@JanPolasek V0.18.2 Scan Code_ 128 is effective for me, although not very clever, it can barely be used. Thank you very much

dolin-tan avatar Sep 12 '23 03:09 dolin-tan

@JanPolasek Oddly, I have no problem scanning the barcode in this issue or the one in #394 with v0.20.0.

But looking at your changes in #574 it does appear there was a conversion mistake. I've made a comment in your code as it could be simplified and made much faster.

teckel12 avatar Sep 14 '23 13:09 teckel12

  • 0.19.2 worked given ideal conditions and a good camera. But is very very very rough.
  • I will now try v0.18.2.

jumafuse avatar Sep 19 '23 10:09 jumafuse

I've used DecodeHintType.TRY_HARDER and it works much better on 0.20.0

piotr-bender-silevis avatar Nov 08 '23 23:11 piotr-bender-silevis