Remove console-messages for production build

pull/91/head
Christoph Oberhofer 10 years ago
parent 835f524b33
commit 47f0169709

@ -104,6 +104,12 @@ file is only valid for the non-uglified version `quagga.js` because the
minified version is altered after compression and does not align with the map
file any more.
### Node
The code in the `dist` folder is only targeted to the browser and won't work in
node due to the dependency on the DOM. For the use in node, the `build` command
also creates a `quagga.js` file in the `lib` folder.
## <a name="api">API</a>
You can check out the [examples][github_examples] to get an idea of how to
@ -545,6 +551,13 @@ on the ``singleChannel`` flag in the configuration when using ``decodeSingle``.
## <a name="changelog">Changelog</a>
### 2016-02-18
- Internal Changes
- Restructuring into meaningful folders
- Removing debug-code in production build
### 2016-02-15
Take a look at the release-notes ([0.9.0]
(https://github.com/serratus/quaggaJS/releases/tag/v0.9.0))

@ -82,13 +82,17 @@ export default {
} else if (typeof readerConfig === 'string') {
reader = readerConfig;
}
if (ENV.development) {
console.log("Before registering reader: ", reader);
}
_barcodeReaders.push(new READERS[reader](configuration));
});
if (ENV.development) {
console.log("Registered Readers: " + _barcodeReaders
.map((reader) => JSON.stringify({format: reader.FORMAT, config: reader.config}))
.join(', '));
}
}
function initConfig() {
if (ENV.development && typeof document !== 'undefined') {

@ -27,7 +27,9 @@ function loadedData(video, callback) {
function checkVideo() {
if (attempts > 0) {
if (video.videoWidth > 0 && video.videoHeight > 0) {
if (ENV.development) {
console.log(video.videoWidth + "px x " + video.videoHeight + "px");
}
callback();
} else {
window.setTimeout(checkVideo, 500);

@ -20,12 +20,14 @@ FrameGrabber.create = function(inputStream, canvas) {
_canvas.height = _canvasSize.y;
_ctx = _canvas.getContext("2d");
_data = new Uint8Array(_size.x * _size.y);
if (ENV.development) {
console.log("FrameGrabber", JSON.stringify({
size: _size,
topRight: topRight,
videoSize: _video_size,
canvasSize: _canvasSize
}));
}
/**
* Uses the given array as frame-buffer

@ -34,7 +34,9 @@ ImageLoader.load = function(directory, callback, offset, size, sequence) {
}
}
if (notloadedImgs.length === 0) {
if (ENV.development) {
console.log("Images loaded");
}
callback.apply(null, [htmlImagesArray]);
}
};

@ -570,7 +570,9 @@ export default {
};
patchSize = CVUtils.calculatePatchSize(config.patchSize, size);
if (ENV.development) {
console.log("Patch-Size: " + JSON.stringify(patchSize));
}
inputStream.setWidth(Math.floor(Math.floor(size.x / patchSize.x) * (1 / halfSample) * patchSize.x));
inputStream.setHeight(Math.floor(Math.floor(size.y / patchSize.y) * (1 / halfSample) * patchSize.y));

@ -90,7 +90,9 @@ function canRecord(cb) {
if (_config.numOfWorkers > 0) {
initWorkers(function() {
if (ENV.development) {
console.log("Workers created");
}
ready(cb);
});
} else {
@ -148,7 +150,9 @@ function initBuffers(imageWrapper) {
});
}
if (ENV.development) {
console.log(_inputImageWrapper.size);
}
_boxSize = [
vec2.clone([0, 0]),
vec2.clone([0, _inputImageWrapper.size.y]),
@ -341,15 +345,19 @@ function initWorker(cb) {
URL.revokeObjectURL(blobURL);
workerThread.busy = false;
workerThread.imageData = new Uint8Array(e.data.imageData);
if (ENV.development) {
console.log("Worker initialized");
}
return cb(workerThread);
} else if (e.data.event === 'processed') {
workerThread.imageData = new Uint8Array(e.data.imageData);
workerThread.busy = false;
publishResult(e.data.result, workerThread.imageData);
} else if (e.data.event === 'error') {
if (ENV.development) {
console.log("Worker error: " + e.data.message);
}
}
};
workerThread.worker.postMessage({
@ -449,7 +457,9 @@ export default {
_stopped = true;
_workerPool.forEach(function(workerThread) {
workerThread.worker.terminate();
if (ENV.development) {
console.log("Worker terminated!");
}
});
_workerPool.length = 0;
if (_config.inputStream.type === "LiveStream") {
@ -489,7 +499,7 @@ export default {
size: 800,
src: config.src
},
numOfWorkers: ENV.development ? 0 : 1,
numOfWorkers: (ENV.development && config.debug) ? 0 : 1,
locator: {
halfSample: false
}

@ -29,7 +29,9 @@ Code39VINReader.prototype._decode = function() {
code = code.replace(patterns.IOQ, '');
if (!code.match(patterns.AZ09)) {
if (ENV.development) {
console.log('Failed AZ09 pattern code:', code);
}
return null;
}

Loading…
Cancel
Save