EddieLa / JOB

A Barcode scanner capapable of reading Code128, Code93, Code39, Standard/Industrial 2 of 5, Interleaved 2 of 5, Codabar and EAN-13 barcodes in javascript.
http://eddiela.github.io/JOB
600 stars 204 forks source link

unable to get project to show image/decode #47

Open pwquigle opened 8 years ago

pwquigle commented 8 years ago

I have downloaded the code and I'm trying to get this working locally. I can get the page to load and I can select/capture an image but the canvas for the image doesnt show and its not displaying a barcode. I have downloaded the ZIP for JOB-gh-pages (trying the index.html) as well as the JOB.git (trying the reader.html in the src folder).

Are there additional steps required to make this operational? I have looked for a step by step guide to implementation but I couldn't find one.

Any suggestions?

IanCaz commented 8 years ago

I'm having the same problem. Trying to run reader.html, I get the following errors in the JavaScript console: BarcodeReader.js:16 - Uncaught ReferenceError: require is not defined barcode-reader.jquery.js:227 - Uncaught ReferenceError: jQuery is not defined Reader.html:14 - Uncaught ReferenceError: $ is not defined

The jQuery errors are simple enough to understand, I evidently need to load jQuery first (even though that's not called out). What I can't figure out is the require call (var EXIF = require('./exif');)

fear025 commented 8 years ago

The require() command looks like a node.js thing to include external files. I don't really understand why it's there either, but try to just copy and paste the code into that spot in the code. For example:

var EXIF2 = (function() { var debug = false; ... }.call(this));

I found I needed to also rename the variable to something other than EXIF (I used EXIF2), as the exif code seems to unpack itself and prepare the EXIF variable that that .call statement.

DanielApt commented 8 years ago

The require parts are a NodeJS function to load modules.

It seems that we'd have to bundle or build the files in the src directory. It's a shame this project doesn't provide any documentation or scripts to achieve this.

One of the quicker wins is to instead download the gh-pages branch, which is the code for the demo page.

@EddieLa, could you provide some instructions on how to build or bundle the scripts? I am happy to send a PR based on your comments.

EddieLa commented 8 years ago

I was not actually involved in this so I can't really provide any instructions. The last commit I was actually involved in was ce1c081 which was prior to the npm integration.

DanielApt commented 8 years ago

Ok, seems like it'll be useful to figure out how to build this project then. Let's keep this issue open until it's addressed.