zxing-js / library

Multi-format 1D/2D barcode image processing library, usable in JavaScript ecosystem.

Home Page:https://zxing-js.github.io/library/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[CODE_128] Can't read barcode

jumafuse opened this issue · 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.

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

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

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

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

@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/

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

Kudos to you!

@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 V0.18.2 Scan Code_ 128 is effective for me, although not very clever, it can barely be used. Thank you very much

@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.

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

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