mirror of
https://github.com/serratus/quaggaJS.git
synced 2026-08-13 05:31:37 +08:00
@@ -1,7 +1,7 @@
|
|||||||
quaggaJS
|
quaggaJS
|
||||||
========
|
========
|
||||||
|
|
||||||
- [Changelog](#changelog) (2015-08-13)
|
- [Changelog](#changelog) (2015-08-29)
|
||||||
|
|
||||||
## What is QuaggaJS?
|
## What is QuaggaJS?
|
||||||
|
|
||||||
@@ -34,10 +34,10 @@ be aligned with the viewport.
|
|||||||
|
|
||||||
In order to take full advantage of quaggaJS, the browser needs to support the
|
In order to take full advantage of quaggaJS, the browser needs to support the
|
||||||
`getUserMedia` API which is already implemented in recent versions of Firefox,
|
`getUserMedia` API which is already implemented in recent versions of Firefox,
|
||||||
Chrome and Opera. The API is also available on their mobile counterparts
|
Chrome, IE (Edge) and Opera. The API is also available on their mobile
|
||||||
installed on Android. Safari and IE do not allow the access to the camera yet,
|
counterparts installed on Android (except IE). Safari does not allow the access
|
||||||
neither on desktop, nor on mobile. You can check [caniuse][caniuse_getusermedia]
|
to the camera yet, neither on desktop, nor on mobile. You can check
|
||||||
for updates.
|
[caniuse][caniuse_getusermedia] for updates.
|
||||||
|
|
||||||
In cases where real-time decoding is not needed, or the platform does not
|
In cases where real-time decoding is not needed, or the platform does not
|
||||||
support `getUserMedia` QuaggaJS is also capable of decoding image-files using
|
support `getUserMedia` QuaggaJS is also capable of decoding image-files using
|
||||||
@@ -377,6 +377,10 @@ on the ``singleChannel`` flag in the configuration when using ``decodeSingle``.
|
|||||||
|
|
||||||
## <a name="changelog">Changelog</a>
|
## <a name="changelog">Changelog</a>
|
||||||
|
|
||||||
|
### 2015-08-29
|
||||||
|
- Improvements
|
||||||
|
- Added support for Internet Explorer (only Edge+ supports `getUserMedia`)
|
||||||
|
|
||||||
### 2015-08-13
|
### 2015-08-13
|
||||||
- Improvements
|
- Improvements
|
||||||
- Added `offProcessed` and `offDetected` methods for detaching event-
|
- Added `offProcessed` and `offDetected` methods for detaching event-
|
||||||
|
|||||||
Vendored
+15
-2
@@ -835,7 +835,15 @@ if (typeof window !== 'undefined') {
|
|||||||
navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia;
|
navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia;
|
||||||
window.URL = window.URL || window.webkitURL || window.mozURL || window.msURL;
|
window.URL = window.URL || window.webkitURL || window.mozURL || window.msURL;
|
||||||
}
|
}
|
||||||
|
Math.imul = Math.imul || function(a, b) {
|
||||||
|
var ah = (a >>> 16) & 0xffff,
|
||||||
|
al = a & 0xffff,
|
||||||
|
bh = (b >>> 16) & 0xffff,
|
||||||
|
bl = b & 0xffff;
|
||||||
|
// the shift by 0 fixes the sign on the high part
|
||||||
|
// the final |0 converts the unsigned value into a signed value
|
||||||
|
return ((al * bl) + (((ah * bl + al * bh) << 16) >>> 0)|0);
|
||||||
|
};
|
||||||
define("typedefs", (function (global) {
|
define("typedefs", (function (global) {
|
||||||
return function () {
|
return function () {
|
||||||
var ret, fn;
|
var ret, fn;
|
||||||
@@ -9084,10 +9092,10 @@ function(InputStream,
|
|||||||
|
|
||||||
blobURL = generateWorkerBlob();
|
blobURL = generateWorkerBlob();
|
||||||
workerThread.worker = new Worker(blobURL);
|
workerThread.worker = new Worker(blobURL);
|
||||||
URL.revokeObjectURL(blobURL);
|
|
||||||
|
|
||||||
workerThread.worker.onmessage = function(e) {
|
workerThread.worker.onmessage = function(e) {
|
||||||
if (e.data.event === 'initialized') {
|
if (e.data.event === 'initialized') {
|
||||||
|
URL.revokeObjectURL(blobURL);
|
||||||
workerThread.busy = false;
|
workerThread.busy = false;
|
||||||
workerThread.imageData = new Uint8Array(e.data.imageData);
|
workerThread.imageData = new Uint8Array(e.data.imageData);
|
||||||
console.log("Worker initialized");
|
console.log("Worker initialized");
|
||||||
@@ -9096,6 +9104,8 @@ function(InputStream,
|
|||||||
workerThread.imageData = new Uint8Array(e.data.imageData);
|
workerThread.imageData = new Uint8Array(e.data.imageData);
|
||||||
workerThread.busy = false;
|
workerThread.busy = false;
|
||||||
publishResult(e.data.result, workerThread.imageData);
|
publishResult(e.data.result, workerThread.imageData);
|
||||||
|
} else if (e.data.event === 'error') {
|
||||||
|
console.log("Worker error: " + e.data.message);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -9110,10 +9120,13 @@ function(InputStream,
|
|||||||
|
|
||||||
function workerInterface(factory) {
|
function workerInterface(factory) {
|
||||||
if (factory) {
|
if (factory) {
|
||||||
|
/* jshint ignore:start */
|
||||||
var Quagga = factory();
|
var Quagga = factory();
|
||||||
if (!Quagga) {
|
if (!Quagga) {
|
||||||
|
self.postMessage({'event': 'error', message: 'Quagga could not be created'});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
/* jshint ignore:end */
|
||||||
}
|
}
|
||||||
/* jshint ignore:start */
|
/* jshint ignore:start */
|
||||||
var imageWrapper;
|
var imageWrapper;
|
||||||
|
|||||||
Vendored
+4
-4
File diff suppressed because one or more lines are too long
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "quagga",
|
"name": "quagga",
|
||||||
"version": "0.6.15",
|
"version": "0.6.16",
|
||||||
"description": "An advanced barcode-scanner written in JavaScript",
|
"description": "An advanced barcode-scanner written in JavaScript",
|
||||||
"main": "dist/quagga.js",
|
"main": "dist/quagga.js",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
+6
-1
@@ -332,10 +332,10 @@ function(InputStream,
|
|||||||
|
|
||||||
blobURL = generateWorkerBlob();
|
blobURL = generateWorkerBlob();
|
||||||
workerThread.worker = new Worker(blobURL);
|
workerThread.worker = new Worker(blobURL);
|
||||||
URL.revokeObjectURL(blobURL);
|
|
||||||
|
|
||||||
workerThread.worker.onmessage = function(e) {
|
workerThread.worker.onmessage = function(e) {
|
||||||
if (e.data.event === 'initialized') {
|
if (e.data.event === 'initialized') {
|
||||||
|
URL.revokeObjectURL(blobURL);
|
||||||
workerThread.busy = false;
|
workerThread.busy = false;
|
||||||
workerThread.imageData = new Uint8Array(e.data.imageData);
|
workerThread.imageData = new Uint8Array(e.data.imageData);
|
||||||
console.log("Worker initialized");
|
console.log("Worker initialized");
|
||||||
@@ -344,6 +344,8 @@ function(InputStream,
|
|||||||
workerThread.imageData = new Uint8Array(e.data.imageData);
|
workerThread.imageData = new Uint8Array(e.data.imageData);
|
||||||
workerThread.busy = false;
|
workerThread.busy = false;
|
||||||
publishResult(e.data.result, workerThread.imageData);
|
publishResult(e.data.result, workerThread.imageData);
|
||||||
|
} else if (e.data.event === 'error') {
|
||||||
|
console.log("Worker error: " + e.data.message);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -358,10 +360,13 @@ function(InputStream,
|
|||||||
|
|
||||||
function workerInterface(factory) {
|
function workerInterface(factory) {
|
||||||
if (factory) {
|
if (factory) {
|
||||||
|
/* jshint ignore:start */
|
||||||
var Quagga = factory();
|
var Quagga = factory();
|
||||||
if (!Quagga) {
|
if (!Quagga) {
|
||||||
|
self.postMessage({'event': 'error', message: 'Quagga could not be created'});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
/* jshint ignore:end */
|
||||||
}
|
}
|
||||||
/* jshint ignore:start */
|
/* jshint ignore:start */
|
||||||
var imageWrapper;
|
var imageWrapper;
|
||||||
|
|||||||
@@ -19,3 +19,12 @@ if (typeof window !== 'undefined') {
|
|||||||
navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia;
|
navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia;
|
||||||
window.URL = window.URL || window.webkitURL || window.mozURL || window.msURL;
|
window.URL = window.URL || window.webkitURL || window.mozURL || window.msURL;
|
||||||
}
|
}
|
||||||
|
Math.imul = Math.imul || function(a, b) {
|
||||||
|
var ah = (a >>> 16) & 0xffff,
|
||||||
|
al = a & 0xffff,
|
||||||
|
bh = (b >>> 16) & 0xffff,
|
||||||
|
bl = b & 0xffff;
|
||||||
|
// the shift by 0 fixes the sign on the high part
|
||||||
|
// the final |0 converts the unsigned value into a signed value
|
||||||
|
return ((al * bl) + (((ah * bl + al * bh) << 16) >>> 0)|0);
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user