JsQRScanner icon indicating copy to clipboard operation
JsQRScanner copied to clipboard

Feature request: Code 128 and others

Open skito opened this issue 5 years ago • 12 comments

Since this great scanner is based on zxing which supports Code128 (most common) and other 1D barcodes, do you think it will be hard to add support for those?

Thanks, Dimitar

skito avatar Apr 20 '20 14:04 skito

It is as simple as uncommenting those two lines: https://github.com/jbialobr/gwt-qrscanner/blob/2f0e6a8e48a46754fbeccaa6434b119f543f9bec/core/src/main/java/com/google/zxing/web/ScannerWidget.java#L26 https://github.com/jbialobr/gwt-qrscanner/blob/2f0e6a8e48a46754fbeccaa6434b119f543f9bec/core/src/main/java/com/google/zxing/web/ScannerWidget.java#L41

jbialobr avatar Apr 21 '20 10:04 jbialobr

Cool! Will give it a try.

Thanks, Dimitar

skito avatar Apr 21 '20 10:04 skito

Hi,

is it possible to add MultiFormatOneDReader to the JsQRScanner by default?

Thanks, René

renejanssen avatar Jan 05 '21 16:01 renejanssen

I would not do it, because it is waisting of cpu cycles when you don't need it. It should be configurable.

jbialobr avatar Jan 05 '21 17:01 jbialobr

Cool! Will give it a try.

Dimitar, were you able to make it work? If so, and if you have time, could you drop a quick note on what you did to rebuild the library? I've never used GWT before. Thanks!

unarsu avatar Aug 25 '21 13:08 unarsu

I would not do it, because it is waisting of cpu cycles when you don't need it. It should be configurable.

mebjas has done something similar with https://github.com/mebjas/html5-qrcode/releases/tag/V2.0.8 but I still can't get 1D barcodes to scan with that library either.

unarsu avatar Aug 25 '21 13:08 unarsu

Dimitar, were you able to make it work? If so, and if you have time, could you drop a quick note on what you did to rebuild the library? I've never used GWT before. Thanks!

You don't have to build it yourself. There are github actions defined to build every commit, so you can fork the project, push changes and github will build it for you.

jbialobr avatar Aug 25 '21 17:08 jbialobr

Cool! Will give it a try.

Dimitar, were you able to make it work? If so, and if you have time, could you drop a quick note on what you did to rebuild the library? I've never used GWT before. Thanks!

@unarsu I don't remember, but I ended up using: https://github.com/zxing-js/library

It's pretty straight forward.

skito avatar Aug 25 '21 18:08 skito

Dimitar, were you able to make it work? If so, and if you have time, could you drop a quick note on what you did to rebuild the library? I've never used GWT before. Thanks!

You don't have to build it yourself. There are github actions defined to build every commit, so you can fork the project, push changes and github will build it for you.

Finally got back to this. I forked both gwt-qrscanner and JsQRScanner and modified the java source files to uncomment the two lines. I then modified JsQRScanner's .gitmodules to point to https://github.com/unarsu/gwt-qrscanner.git. The workflow did trigger, but if I go into https://github.com/unarsu/JsQRScanner/tree/master/docs/js, the files are pretty old.

I also noticed a link in your JsQRScanner project that points to gwt-qrscanner @ 0e3eb59, but I don't see how I could edit it to point to my fork, if that's the problem.

Any ideas? I'm pretty new to github. Thanks!

unarsu avatar Aug 30 '21 18:08 unarsu

Your builds are here:

image

Click on the build and go to the Artifacts section to download compiled js:

image

Direct link to your build of the minified version: https://github.com/unarsu/JsQRScanner/actions/runs/1182980543

jbialobr avatar Aug 30 '21 18:08 jbialobr

Thanks so much. You are incredibly generous!

unarsu avatar Aug 30 '21 20:08 unarsu

So I threw the demo program up on a test server (needs an https certificate for camera permissions to succeed on iOS), and connected to the server using an iPad running iPadOS 14.7.1. It works well on QR codes, but doesn't scan Aztec 2D or UPC-A (really any 1D barcodes as I have some receipts I tried, and it didn't scan those either). With mebjas's project i do get Aztec 2D to work, but none of the UPC-A or 1D barcodes work there either. I'm guessing that there's something in recent zxing releases that has broken them on iOS-- I'm fairly sure they worked in the past.

I then tried using my work Windows laptop, using Chrome and the crappy webcam, and got the same results. I'll try to debug on my desktop, since iOS devices are horrible to debug.

unarsu avatar Aug 30 '21 21:08 unarsu