Comparing version 0.6.16 to 0.7.0
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 2 instances in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
High entropy strings
Supply chain riskContains high entropy strings. This could be a sign of encrypted data, leaked secrets or obfuscated code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
567
3
1
756696
5
19
57
14102
+ Addedget-pixels@^3.2.3
+ Addedgl-matrix@^2.3.1
+ Addedndarray@^1.0.18
+ Addedrequirejs@^2.1.20
+ Addedajv@6.12.6(transitive)
+ Addedasn1@0.2.6(transitive)
+ Addedassert-plus@1.0.0(transitive)
+ Addedasynckit@0.4.0(transitive)
+ Addedaws-sign2@0.7.0(transitive)
+ Addedaws4@1.13.2(transitive)
+ Addedbcrypt-pbkdf@1.0.2(transitive)
+ Addedcaseless@0.12.0(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addedcore-util-is@1.0.2(transitive)
+ Addedcwise-compiler@1.1.3(transitive)
+ Addeddashdash@1.14.1(transitive)
+ Addeddata-uri-to-buffer@0.0.3(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addedecc-jsbn@0.1.2(transitive)
+ Addedextend@3.0.2(transitive)
+ Addedextsprintf@1.3.0(transitive)
+ Addedfast-deep-equal@3.1.3(transitive)
+ Addedfast-json-stable-stringify@2.1.0(transitive)
+ Addedforever-agent@0.6.1(transitive)
+ Addedform-data@2.3.3(transitive)
+ Addedget-pixels@3.3.3(transitive)
+ Addedgetpass@0.1.7(transitive)
+ Addedgl-matrix@2.8.1(transitive)
+ Addedhar-schema@2.0.0(transitive)
+ Addedhar-validator@5.1.5(transitive)
+ Addedhttp-signature@1.2.0(transitive)
+ Addediota-array@1.0.0(transitive)
+ Addedis-buffer@1.1.6(transitive)
+ Addedis-typedarray@1.0.0(transitive)
+ Addedisstream@0.1.2(transitive)
+ Addedjpeg-js@0.4.4(transitive)
+ Addedjsbn@0.1.1(transitive)
+ Addedjson-schema@0.4.0(transitive)
+ Addedjson-schema-traverse@0.4.1(transitive)
+ Addedjson-stringify-safe@5.0.1(transitive)
+ Addedjsprim@1.4.2(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedndarray@1.0.19(transitive)
+ Addedndarray-linear-interpolate@1.0.0(transitive)
+ Addedndarray-pack@1.2.1(transitive)
+ Addednode-bitmap@0.0.1(transitive)
+ Addedoauth-sign@0.9.0(transitive)
+ Addedomggif@1.0.10(transitive)
+ Addedparse-data-uri@0.2.0(transitive)
+ Addedperformance-now@2.1.0(transitive)
+ Addedpngjs@3.4.0(transitive)
+ Addedpsl@1.13.0(transitive)
+ Addedpunycode@2.3.1(transitive)
+ Addedqs@6.5.3(transitive)
+ Addedrequest@2.88.2(transitive)
+ Addedrequirejs@2.3.7(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedsshpk@1.18.0(transitive)
+ Addedthrough@2.3.8(transitive)
+ Addedtough-cookie@2.5.0(transitive)
+ Addedtunnel-agent@0.6.0(transitive)
+ Addedtweetnacl@0.14.5(transitive)
+ Addeduniq@1.0.1(transitive)
+ Addeduri-js@4.4.1(transitive)
+ Addeduuid@3.4.0(transitive)
+ Addedverror@1.10.0(transitive)