barcode.js icon indicating copy to clipboard operation
barcode.js copied to clipboard

One-Dimensional Barcode Support

Open dsanders11 opened this issue 9 years ago • 4 comments

Is there any interest in extending this project to include support for barcodes? The name insinuates that there may be plans to support more than just QR codes. I have a use case for scanning Code 128 barcodes in JavaScript and the existing projects I've been able to find are not great. I've been using the QR code functionality in this project with great results.

This project is a very clean port of XZing (great use of Closure) and makes great use of WebGL and web workers. It seems like it would be a great base to port the barcode reading code into. It looks like many of the necessary classes have already been ported.

So, would work towards this end be accepted into this project, or is the goal to keep it QR code only?

dsanders11 avatar Apr 15 '16 15:04 dsanders11

Thank you. It was indeed a goal to keep it close to the java-code to ease porting future changes from zxing. I originally planned adding support for barcodes too, but just did not really need them at the time. So any PRs are welcome.

Schibum avatar Apr 25 '16 08:04 Schibum

So any PRs are welcome.

I'll probably make some PRs over the next few months. It's a low priority need for me, but it's one I'd like to get to if I can find the time. The code in XZing for one-dimensional barcodes has been fairly untouched for a while now so there's no real risk in doing a slow port.

I think the first step would be reorganizing the internal structure a little bit to match with the XZing layout, such as bitmatrix.js and bitarray.js moving to a common folder, etc. For ease of porting emulating the directory layout when possible would be nice.

Do you have a preference on the file naming convention? Most of the files are all lowercase in filename (which differs from XZing) but the files under encoder keep the camel case from XZing. I want to make sure any future pull requests keep the style consistent rather than making it more muddled.

dsanders11 avatar Apr 25 '16 15:04 dsanders11

Sound's great.

I prefer the conventions of the Google Javascript Style Guide style guide for this. Most of this should be checked the gulp gjslint task. Filenames should be lowercase - this must have slipped though.

Schibum avatar Apr 29 '16 08:04 Schibum

Alright, sounds good to me.

dsanders11 avatar Apr 30 '16 03:04 dsanders11