jbialobr / JsQRScanner

JavaScript QR Code scanner for HTML5 supporting browsers
Apache License 2.0
309 stars 116 forks source link

Feature request: Code 128 and others #29

Open skito opened 4 years ago

skito commented 4 years ago

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

jbialobr commented 4 years ago

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

skito commented 4 years ago

Cool! Will give it a try.

Thanks, Dimitar

renejanssen commented 3 years ago

Hi,

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

Thanks, René

jbialobr commented 3 years ago

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

unarsu commented 3 years ago

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 commented 3 years ago

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.

jbialobr commented 3 years ago

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.

skito commented 3 years ago

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.

unarsu commented 3 years ago

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!

jbialobr commented 3 years ago

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

unarsu commented 3 years ago

Thanks so much. You are incredibly generous!

unarsu commented 3 years ago

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.