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

1.6.1 example doesn't work... #41

Open Kujako opened 8 years ago

Kujako commented 8 years ago

Trying to review the changes in 1.6.1, however the Reader.html in the src folder fails to load, throwing various javascript errors. Main problem was that jQuery wasn't loaded, but after adding a call to it in the head I am still seeing....

"Uncaught ReferenceError: BarcodeReader is not defined" at line 45 in "barcode-reader.jquery.js"

I've tried a few things, but seem unable to diagnose the problem. Any assistance would be appreciated.

seipekm commented 8 years ago

i have the same problem

modeverv commented 8 years ago

I have the same problem... https://4d68a3175137e650a3ee240c929c8bd26e8ef3db.googledrive.com/host/0B18k-I2MKH8PdXppRkRfVWdJT0k/job/ this page's example is work now(via iPhone)

Kujako commented 8 years ago

The linked page appears to be the old "job.js" version and not the new 1.6.1 build, which uses "BarcodeReader.js" and "barcode-reaser.jquery.js".

jkumawat commented 8 years ago

Can any one tell me what has to be done to work with current version 1.6.1 build? I have been trying to use this library in my project but there are always some problem which were already mentioned in above post.

1) Jquery reference missing 2) require() is undefined. 3) "Uncaught ReferenceError: BarcodeReader is not defined" at line 45 in "barcode-reader.jquery.js"

@Kujako : Can you please suggest me what can be the proabable solution?

like .

Kujako commented 8 years ago

@jkumawat Sorry, wasn't able to find a work around. Waiting for another update before I return to this project.

bastienjalbert commented 8 years ago

I have got these errors too ...

nmovazquez commented 8 years ago

i Trying to replay this example https://4d68a3175137e650a3ee240c929c8bd26e8ef3db.googledrive.com/host/0B18k-I2MKH8PdXppRkRfVWdJT0k/job/ but still have the problem, could you help me please. the problem its the same that the first after uploading the image does nothing @modeverv

tsalufe commented 7 years ago

This what I did to work around jquery/require/uncaughtReference by tweaking plugin js:

  1. remove the two require() in BarcodeReader, instead, add script tag with src pointing to the two js files: exif.js, DecoderWorker.js.
  2. in exif.js, remove var before "root = this" to make root global. Otherwise, root is undefined.

I tried to define require() before loading BarcodeReader.js but because exif.js is loaded async, BarcodeReader still complains root is undefined. Though it is NOT a good practice to tweak plugin code, it is worth doing that in my case because this js BarcodeReader seems better than QuaggaJS(https://serratus.github.io/quaggaJS/) with low quality image from my testing (except that I have align barcode horizontally which is fine for us so far). Hope this helps.

CDIDEV commented 7 years ago

@tsalufe like this?

// var EXIF = require('./exif');
// var decoderWorkerBlobString = require('./DecoderWorker');

<script src="exif.js"></script>
<script src="js/DecoderWorker.js"></script>

var BarcodeReader = {
.
.
.
}
tsalufe commented 7 years ago

@CDIDEV Correct but BarcodeReader is a class already defined in BarcodeReader.js. You just need to load BarcodeReader.js. See src/Reader.html.

// var EXIF = require('./exif'); // var decoderWorkerBlobString = require('./DecoderWorker');

<script src="exif.js"></script> <script src="js/DecoderWorker.js"></script> <script src="js/BarcodeReader.js"></script>

dhana6795 commented 6 years ago

@tsalufe can u tell me how you aligned the image whether you changed any settings or camera position for me sometimes this detecting the barcode and some times its not working can u help me

tsalufe commented 6 years ago

@dhana6795 I normally align it horizontally. Move your camera closer or only process cropped barcode out of large image might help.

dhana6795 commented 6 years ago

@tsalufe thank you..