mobstac-private / tqrcg-barcode.js

Javascript QR Code library
Apache License 2.0
49 stars 9 forks source link

One-Dimensional Barcode Support #7

Open dsanders11 opened 8 years ago

dsanders11 commented 8 years ago

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?

Schibum commented 8 years ago

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.

dsanders11 commented 8 years ago

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.

Schibum commented 8 years ago

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.

dsanders11 commented 8 years ago

Alright, sounds good to me.