Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

quagga

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

quagga - npm Package Compare versions

Comparing version 0.6.16 to 0.7.0

lib/frame_grabber.js

11

Gruntfile.js

@@ -48,10 +48,2 @@ module.exports = function(grunt) {

"exports" : "typedefs"
},
"glMatrix" : {
"deps" : ["typedefs"],
"exports" : "glMatrix"
},
"glMatrixAddon" : {
"deps" : ["glMatrix"],
"exports" : "glMatrixAddon"
}

@@ -62,4 +54,3 @@ },

"typedefs" : "typedefs",
"glMatrix" : "vendor/glMatrix",
"glMatrixAddon" : "glMatrixAddon"
"gl-matrix": "../node_modules/gl-matrix/dist/gl-matrix-min"
}

@@ -66,0 +57,0 @@ }

@@ -7,5 +7,5 @@ module.exports = function(config) {

'test-main.js',
'src/vendor/glMatrix.js',
'src/typedefs.js',
{pattern: 'node_modules/async/lib/async.js', included: false},
{pattern: 'node_modules/gl-matrix/dist/gl-matrix-min.js', included: false},
{pattern: 'src/*.js', included: false},

@@ -12,0 +12,0 @@ {pattern: 'spec/**/*integration.spec.js', included: false},

@@ -7,5 +7,5 @@ module.exports = function(config) {

'test-main.js',
'src/vendor/glMatrix.js',
'src/typedefs.js',
{pattern: 'node_modules/async/lib/async.js', included: false},
{pattern: 'node_modules/gl-matrix/dist/gl-matrix-min.js', included: false},
{pattern: 'src/*.js', included: false},

@@ -12,0 +12,0 @@ {pattern: 'spec/**/*.js', included: false},

{
"name": "quagga",
"version": "0.6.16",
"version": "0.7.0",
"description": "An advanced barcode-scanner written in JavaScript",
"main": "dist/quagga.js",
"main": "lib/quagga.js",
"browser": "dist/quagga.js",
"devDependencies": {
"async": "^0.9.0",
"grunt": "~0.4.5",
"grunt-contrib-jshint": "~0.10.0",
"grunt-contrib-nodeunit": "~0.4.1",
"grunt-contrib-uglify": "~0.5.0",
"grunt-karma": "^0.9.0",
"async": "^1.4.2",
"chai": "^3.2.0",
"grunt": "^0.4.5",
"grunt-contrib-jshint": "^0.11.3",
"grunt-contrib-nodeunit": "^0.4.1",
"grunt-contrib-uglify": "^0.9.2",
"grunt-karma": "^0.12.1",
"grunt-requirejs": "^0.4.2",
"karma": "latest",
"karma-chai": "latest",
"karma-chrome-launcher": "^0.1.12",
"karma-coverage": "^0.3.1",
"karma-mocha": "latest",
"karma-phantomjs-launcher": "^0.1.4",
"karma-requirejs": "^0.2.2",
"karma": "^0.13.9",
"karma-chai": "0.1.0",
"karma-chrome-launcher": "^0.2.0",
"karma-coverage": "^0.5.2",
"karma-mocha": "~0.2.0",
"karma-phantomjs-launcher": "^0.2.1",
"karma-requirejs": "~0.2.2",
"karma-sinon": "^1.0.4",
"karma-sinon-chai": "^0.2.0",
"sinon": "^1.12.1"
"karma-sinon-chai": "~0.2.0",
"mocha": "^2.3.2",
"sinon": "^1.16.1"
},

@@ -52,3 +55,10 @@ "directories": {

"author": "Christoph Oberhofer <ch.oberhofer@gmail.com>",
"license": "MIT"
"license": "MIT",
"dependencies": {
"get-pixels": "^3.2.3",
"gl-matrix": "^2.3.1",
"ndarray": "^1.0.18",
"ndarray-linear-interpolate": "^1.0.0",
"requirejs": "^2.1.20"
}
}
quaggaJS
========
- [Changelog](#changelog) (2015-08-29)
- [Changelog](#changelog) (2015-09-15)

@@ -46,8 +46,8 @@ ## What is QuaggaJS?

## Getting Started
## Installing
You can simply include `dist/quagga.min.js` in your project and you are ready
to go.
QuaggaJS can be installed using __npm__, __bower__, or by including it with
the __script__ tag.
If you want to keep your project modular, you can also install QuaggaJS via npm:
### NPM

@@ -61,8 +61,29 @@ ```console

```javascript
var quagga = require('quagga');
var Quagga = require('quagga');
```
Currently, the full functionality is only available through the browser. When
using QuaggaJS within __node__, only file-based decoding is available. See the
example for [node_examples](#node-example).
### Bower
You can also install QuaggaJS through __bower__:
```console
> bower install quagga
```
### Script-Tag Anno 1998
You can simply include `dist/quagga.min.js` in your project and you are ready
to go.
## Getting Started
For starters, have a look at the [examples][github_examples] to get an idea
where to go from here.
## <a name="Building">Building</a>

@@ -300,6 +321,38 @@

}, function(result){
console.log(result);
if(result.codeResult) {
console.log("result", result.codeResult.code);
} else {
console.log("not detected");
}
});
```
### <a name="node-example">Using node</a>
The following example illustrates the use of QuaggaJS within a node
environment. It's almost identical to the browser version with the difference
that node does not support web-workers out of the box. Therefore the config
property `numOfWorkers` must be explicitly set to `0`.
```javascript
var Quagga = require('quagga');
Quagga.decodeSingle({
src: "image-abc-123.jpg",
numOfWorkers: 0, // Needs to be 0 when used within node
inputStream: {
size: 800 // restrict input-size to be 800px in width (long-side)
},
decoder: {
readers: ["code_128_reader"] // List of active readers
},
}, function(result) {
if(result.codeResult) {
console.log("result", result.codeResult.code);
} else {
console.log("not detected");
}
});
```
## Tests

@@ -383,2 +436,10 @@

### 2015-09-15
Take a look at the release-notes ([0.7.0]
(https://github.com/serratus/quaggaJS/releases/tag/v0.7.0))
- Features
- Added basic support for running QuaggaJS inside __node__ (see [example]
(#node-example))
### 2015-08-29

@@ -385,0 +446,0 @@ - Improvements

/* jshint undef: true, unused: true, browser:true, devel: true */
/* global define, mat2, vec2 */
/* global define */
define("barcode_locator", ["image_wrapper", "cv_utils", "rasterizer", "tracer", "skeletonizer", "array_helper", "image_debug"],
function(ImageWrapper, CVUtils, Rasterizer, Tracer, skeletonizer, ArrayHelper, ImageDebug) {
define("barcode_locator", ["image_wrapper", "cv_utils", "rasterizer", "tracer", "skeletonizer", "array_helper", "image_debug", "gl-matrix"],
function(ImageWrapper, CVUtils, Rasterizer, Tracer, skeletonizer, ArrayHelper, ImageDebug, glMatrix) {

@@ -28,2 +28,4 @@ var _config,

_skeletonizer,
vec2 = glMatrix.vec2,
mat2 = glMatrix.mat2,
self = this;

@@ -104,5 +106,4 @@

//console.log(overAvg);
overAvg = (180 - overAvg) * Math.PI / 180;
transMat = mat2.create([Math.cos(overAvg), -Math.sin(overAvg), Math.sin(overAvg), Math.cos(overAvg)]);
transMat = mat2.clone([Math.cos(overAvg), Math.sin(overAvg), -Math.sin(overAvg), Math.cos(overAvg)]);

@@ -113,3 +114,3 @@ // iterate over patches and rotate by angle

for ( j = 0; j < 4; j++) {
mat2.xVec2(transMat, patch.box[j]);
vec2.transformMat2(patch.box[j], patch.box[j], transMat);
}

@@ -149,5 +150,5 @@

// reverse rotation;
transMat = mat2.inverse(transMat);
transMat = mat2.invert(transMat, transMat);
for ( j = 0; j < 4; j++) {
mat2.xVec2(transMat, box[j]);
vec2.transformMat2(box[j], box[j], transMat);
}

@@ -160,3 +161,3 @@

for ( j = 0; j < 4; j++) {
vec2.scale(box[j], scale);
vec2.scale(box[j], box[j], scale);
}

@@ -385,6 +386,6 @@

},
box : [vec2.create([x, y]), vec2.create([x + _subImageWrapper.size.x, y]), vec2.create([x + _subImageWrapper.size.x, y + _subImageWrapper.size.y]), vec2.create([x, y + _subImageWrapper.size.y])],
box : [vec2.clone([x, y]), vec2.clone([x + _subImageWrapper.size.x, y]), vec2.clone([x + _subImageWrapper.size.x, y + _subImageWrapper.size.y]), vec2.clone([x, y + _subImageWrapper.size.y])],
moments : matchingMoments,
rad : avg,
vec : vec2.create([Math.cos(avg), Math.sin(avg)])
vec : vec2.clone([Math.cos(avg), Math.sin(avg)])
};

@@ -391,0 +392,0 @@ patchesFound.push(patch);

/* jshint undef: true, unused: true, browser:true, devel: true */
/* global define, vec2 */
/* global define */
define(function() {
define(["gl-matrix"], function(glMatrix) {
"use strict";
var vec2 = glMatrix.vec2;
/**

@@ -14,3 +15,3 @@ * Creates a cluster for grouping similar orientations of datapoints

rad : 0,
vec : vec2.create([0, 0])
vec : vec2.clone([0, 0])
}, pointMap = {};

@@ -34,3 +35,3 @@

center.rad = sum / points.length;
center.vec = vec2.create([Math.cos(center.rad), Math.sin(center.rad)]);
center.vec = vec2.clone([Math.cos(center.rad), Math.sin(center.rad)]);
}

@@ -37,0 +38,0 @@

/* jshint undef: true, unused: true, browser:true, devel: true */
/* global define, vec2, vec3 */
/* global define */
define(['cluster', 'glMatrixAddon', "array_helper"], function(Cluster2, glMatrixAddon, ArrayHelper) {
define(['cluster', "array_helper", "gl-matrix"], function(Cluster2, ArrayHelper, glMatrix) {

@@ -17,3 +17,5 @@ "use strict";

var CVUtils = {};
var CVUtils = {},
vec2 = glMatrix.vec2,
vec3 = glMatrix.vec3;

@@ -30,6 +32,6 @@ /**

toVec2 : function() {
return vec2.create([this.x, this.y]);
return vec2.clone([this.x, this.y]);
},
toVec3 : function() {
return vec3.create([this.x, this.y, 1]);
return vec3.clone([this.x, this.y, 1]);
},

@@ -36,0 +38,0 @@ round : function() {

/* jshint undef: true, unused: true, browser:true, devel: true */
/* global define, vec2, mat2 */
/* global define */

@@ -7,7 +7,10 @@ define([

"cv_utils",
"array_helper"
"array_helper",
"gl-matrix"
],
function(SubImage, CVUtils, ArrayHelper) {
function(SubImage, CVUtils, ArrayHelper, glMatrix) {
'use strict';
var vec2 = glMatrix.vec2,
mat2 = glMatrix.mat2;

@@ -66,7 +69,7 @@ /**

var w = outImg.size.x, h = outImg.size.y, iw = inImg.size.x, ih = inImg.size.y;
var across = vec2.create([M[0], M[2]]);
var down = vec2.create([M[1], M[3]]);
var across = vec2.clone([M[0], M[2]]);
var down = vec2.clone([M[1], M[3]]);
var defaultValue = 0;
var p0 = vec2.subtract(inOrig, mat2.xVec2(M, outOrig, vec2.create()), vec2.create());
var p0 = vec2.subtract(inOrig, mat2.xVec2(M, outOrig, vec2.clone()), vec2.clone());

@@ -99,3 +102,3 @@ var min_x = p0[0], min_y = p0[1];

var carrigeReturn = vec2.subtract(down, vec2.scale(across, w, vec2.create()), vec2.create());
var carrigeReturn = vec2.subtract(down, vec2.scale(across, w, vec2.clone()), vec2.clone());

@@ -352,3 +355,3 @@ if (min_x >= 0 && min_y >= 0 && max_x < iw - 1 && max_y < ih - 1) {

label.rad = tmp > PI ? tmp - PI : tmp;
label.vec = vec2.create([Math.cos(tmp), Math.sin(tmp)]);
label.vec = vec2.clone([Math.cos(tmp), Math.sin(tmp)]);
result.push(label);

@@ -355,0 +358,0 @@ }

/* jshint undef: true, unused: true, browser:true, devel: true, evil: true */
/* global define, vec2 */
/* global define */
define([

@@ -16,2 +14,3 @@ "input_stream",

"image_debug",
"gl-matrix",
"result_collector"],

@@ -28,2 +27,3 @@ function(InputStream,

ImageDebug,
glMatrix,
ResultCollector) {

@@ -50,2 +50,3 @@ "use strict";

_onUIThread = true,
vec2 = glMatrix.vec2,
_resultCollector;

@@ -180,6 +181,6 @@

_boxSize = [
vec2.create([0, 0]),
vec2.create([0, _inputImageWrapper.size.y]),
vec2.create([_inputImageWrapper.size.x, _inputImageWrapper.size.y]),
vec2.create([_inputImageWrapper.size.x, 0])
vec2.clone([0, 0]),
vec2.clone([0, _inputImageWrapper.size.y]),
vec2.clone([_inputImageWrapper.size.x, _inputImageWrapper.size.y]),
vec2.clone([_inputImageWrapper.size.x, 0])
];

@@ -194,6 +195,6 @@ BarcodeLocator.init(_inputImageWrapper, _config.locator);

return [[
vec2.create(_boxSize[0]),
vec2.create(_boxSize[1]),
vec2.create(_boxSize[2]),
vec2.create(_boxSize[3])]];
vec2.clone(_boxSize[0]),
vec2.clone(_boxSize[1]),
vec2.clone(_boxSize[2]),
vec2.clone(_boxSize[3])]];
}

@@ -200,0 +201,0 @@ }

@@ -21,3 +21,2 @@ var allTestFiles = [];

'typedefs': 'src/typedefs',
'glMatrixAddon': 'src/glMatrixAddon',
'cluster': 'src/cluster',

@@ -51,2 +50,3 @@ 'camera_access': 'src/camera_access',

'async': 'node_modules/async/lib/async',
'gl-matrix': 'node_modules/gl-matrix/dist/gl-matrix-min',
'result_collector': 'src/result_collector',

@@ -53,0 +53,0 @@ 'i2of5_reader': 'src/i2of5_reader'

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc