preparing ean-extended release
@@ -46,6 +46,7 @@
|
|||||||
<option value="code_39">Code 39</option>
|
<option value="code_39">Code 39</option>
|
||||||
<option value="code_39_vin">Code 39 VIN</option>
|
<option value="code_39_vin">Code 39 VIN</option>
|
||||||
<option value="ean">EAN</option>
|
<option value="ean">EAN</option>
|
||||||
|
<option value="ean_extended">EAN-extended</option>
|
||||||
<option value="ean_8">EAN-8</option>
|
<option value="ean_8">EAN-8</option>
|
||||||
<option value="upc">UPC</option>
|
<option value="upc">UPC</option>
|
||||||
<option value="upc_e">UPC-E</option>
|
<option value="upc_e">UPC-E</option>
|
||||||
|
|||||||
@@ -82,21 +82,37 @@ $(function() {
|
|||||||
},
|
},
|
||||||
decoder: {
|
decoder: {
|
||||||
readers: function(value) {
|
readers: function(value) {
|
||||||
return [value + "_reader"];
|
if (value === 'ean_extended') {
|
||||||
|
return [{
|
||||||
|
format: "ean_reader",
|
||||||
|
config: {
|
||||||
|
supplements: [
|
||||||
|
'ean_5_reader', 'ean_2_reader'
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
return [{
|
||||||
|
format: value + "_reader",
|
||||||
|
config: {}
|
||||||
|
}];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
state: {
|
state: {
|
||||||
inputStream: {
|
inputStream: {
|
||||||
size: 640,
|
size: 800,
|
||||||
singleChannel: false
|
singleChannel: false
|
||||||
},
|
},
|
||||||
locator: {
|
locator: {
|
||||||
patchSize: "large",
|
patchSize: "medium",
|
||||||
halfSample: false
|
halfSample: true
|
||||||
},
|
},
|
||||||
decoder: {
|
decoder: {
|
||||||
readers: ["code_128_reader"]
|
readers: [{
|
||||||
|
format: "code_128_reader",
|
||||||
|
config: {}
|
||||||
|
}]
|
||||||
},
|
},
|
||||||
locate: true,
|
locate: true,
|
||||||
src: null
|
src: null
|
||||||
|
|||||||
@@ -38,6 +38,7 @@
|
|||||||
<option value="code_39">Code 39</option>
|
<option value="code_39">Code 39</option>
|
||||||
<option value="code_39_vin">Code 39 VIN</option>
|
<option value="code_39_vin">Code 39 VIN</option>
|
||||||
<option value="ean">EAN</option>
|
<option value="ean">EAN</option>
|
||||||
|
<option value="ean_extended">EAN-extended</option>
|
||||||
<option value="ean_8">EAN-8</option>
|
<option value="ean_8">EAN-8</option>
|
||||||
<option value="upc">UPC</option>
|
<option value="upc">UPC</option>
|
||||||
<option value="upc_e">UPC-E</option>
|
<option value="upc_e">UPC-E</option>
|
||||||
|
|||||||
@@ -107,7 +107,20 @@ $(function() {
|
|||||||
},
|
},
|
||||||
decoder: {
|
decoder: {
|
||||||
readers: function(value) {
|
readers: function(value) {
|
||||||
return [value + "_reader"];
|
if (value === 'ean_extended') {
|
||||||
|
return [{
|
||||||
|
format: "ean_reader",
|
||||||
|
config: {
|
||||||
|
supplements: [
|
||||||
|
'ean_5_reader', 'ean_2_reader'
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
return [{
|
||||||
|
format: value + "_reader",
|
||||||
|
config: {}
|
||||||
|
}];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -126,7 +139,10 @@ $(function() {
|
|||||||
},
|
},
|
||||||
numOfWorkers: 4,
|
numOfWorkers: 4,
|
||||||
decoder: {
|
decoder: {
|
||||||
readers : [ "code_128_reader"]
|
readers : [{
|
||||||
|
format: "code_128_reader",
|
||||||
|
config: {}
|
||||||
|
}]
|
||||||
},
|
},
|
||||||
locate: true
|
locate: true
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -39,6 +39,7 @@
|
|||||||
<option value="code_39">Code 39</option>
|
<option value="code_39">Code 39</option>
|
||||||
<option value="code_39_vin">Code 39 VIN</option>
|
<option value="code_39_vin">Code 39 VIN</option>
|
||||||
<option value="ean">EAN</option>
|
<option value="ean">EAN</option>
|
||||||
|
<option value="ean_extended">EAN-extended</option>
|
||||||
<option value="ean_8">EAN-8</option>
|
<option value="ean_8">EAN-8</option>
|
||||||
<option value="upc">UPC</option>
|
<option value="upc">UPC</option>
|
||||||
<option value="upc_e">UPC-E</option>
|
<option value="upc_e">UPC-E</option>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
$(function() {
|
$(function() {
|
||||||
var App = {
|
var App = {
|
||||||
init: function() {
|
init: function() {
|
||||||
var config = this.config[this.state.decoder.readers[0]] || this.config.default;
|
var config = this.config[this.state.decoder.readers[0].format] || this.config.default;
|
||||||
config = $.extend(true, {}, config, this.state);
|
config = $.extend(true, {}, config, this.state);
|
||||||
Quagga.init(config, function() {
|
Quagga.init(config, function() {
|
||||||
App.attachListeners();
|
App.attachListeners();
|
||||||
@@ -95,7 +95,20 @@ $(function() {
|
|||||||
inputMapper: {
|
inputMapper: {
|
||||||
decoder: {
|
decoder: {
|
||||||
readers: function(value) {
|
readers: function(value) {
|
||||||
return [value + "_reader"];
|
if (value === 'ean_extended') {
|
||||||
|
return [{
|
||||||
|
format: "ean_reader",
|
||||||
|
config: {
|
||||||
|
supplements: [
|
||||||
|
'ean_5_reader', 'ean_2_reader'
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
return [{
|
||||||
|
format: value + "_reader",
|
||||||
|
config: {}
|
||||||
|
}];
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
inputStream: {
|
inputStream: {
|
||||||
@@ -109,7 +122,10 @@ $(function() {
|
|||||||
src: "../test/fixtures/code_128/"
|
src: "../test/fixtures/code_128/"
|
||||||
},
|
},
|
||||||
decoder : {
|
decoder : {
|
||||||
readers : ["code_128_reader"]
|
readers : [{
|
||||||
|
format: "code_128_reader",
|
||||||
|
config: {}
|
||||||
|
}]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
|
After Width: | Height: | Size: 679 KiB |
|
After Width: | Height: | Size: 766 KiB |
|
After Width: | Height: | Size: 805 KiB |
|
After Width: | Height: | Size: 697 KiB |
|
After Width: | Height: | Size: 351 KiB |
|
After Width: | Height: | Size: 869 KiB |
|
After Width: | Height: | Size: 601 KiB |
|
After Width: | Height: | Size: 355 KiB |
|
After Width: | Height: | Size: 706 KiB |
|
After Width: | Height: | Size: 746 KiB |
|
After Width: | Height: | Size: 692 KiB |
|
After Width: | Height: | Size: 86 KiB |
|
After Width: | Height: | Size: 104 KiB |
|
After Width: | Height: | Size: 94 KiB |
|
After Width: | Height: | Size: 82 KiB |
|
After Width: | Height: | Size: 140 KiB |
|
After Width: | Height: | Size: 111 KiB |
|
After Width: | Height: | Size: 96 KiB |
|
After Width: | Height: | Size: 106 KiB |
|
After Width: | Height: | Size: 109 KiB |
|
After Width: | Height: | Size: 91 KiB |
@@ -27,15 +27,19 @@ describe('decodeSingle', function () {
|
|||||||
function _runTestSet(testSet, config) {
|
function _runTestSet(testSet, config) {
|
||||||
var readers = config.decoder.readers.slice(),
|
var readers = config.decoder.readers.slice(),
|
||||||
format,
|
format,
|
||||||
folder;
|
folder,
|
||||||
|
suffix;
|
||||||
|
|
||||||
if (typeof readers[0] === 'string'){
|
if (typeof readers[0] === 'string'){
|
||||||
format = readers[0];
|
format = readers[0];
|
||||||
} else {
|
} else {
|
||||||
|
if (readers[0].config && readers[0].config.supplements && readers[0].config.supplements.length) {
|
||||||
|
suffix = "extended";
|
||||||
|
}
|
||||||
format = readers[0].format;
|
format = readers[0].format;
|
||||||
}
|
}
|
||||||
|
|
||||||
folder = baseFolder + format.split('_').slice(0, -1).join('_') + "/";
|
folder = baseFolder + format.split('_').slice(0, -1).concat(suffix ? [suffix] : []).join('_') + "/";
|
||||||
|
|
||||||
it('should decode ' + folder + " correctly", function(done) {
|
it('should decode ' + folder + " correctly", function(done) {
|
||||||
async.eachSeries(testSet, function (sample, callback) {
|
async.eachSeries(testSet, function (sample, callback) {
|
||||||
@@ -76,6 +80,49 @@ describe('decodeSingle', function () {
|
|||||||
_runTestSet(testSet, config);
|
_runTestSet(testSet, config);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe("EAN-extended", function() {
|
||||||
|
var config = {
|
||||||
|
inputStream: {
|
||||||
|
size: 800,
|
||||||
|
singleChannel: false
|
||||||
|
},
|
||||||
|
locator: {
|
||||||
|
patchSize: "medium",
|
||||||
|
halfSample: true
|
||||||
|
},
|
||||||
|
numOfWorkers: 0,
|
||||||
|
decoder: {
|
||||||
|
readers: [{
|
||||||
|
format: "ean_reader",
|
||||||
|
config: {
|
||||||
|
supplements: [
|
||||||
|
'ean_5_reader', 'ean_2_reader'
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
locate: true,
|
||||||
|
src: null
|
||||||
|
},
|
||||||
|
testSet = [
|
||||||
|
{"name": "image-001.jpg", "result": "900437801102701"},
|
||||||
|
{"name": "image-002.jpg", "result": "419871600890101"},
|
||||||
|
{"name": "image-003.jpg", "result": "419871600890101"},
|
||||||
|
{"name": "image-004.jpg", "result": "978054466825652495"},
|
||||||
|
{"name": "image-005.jpg", "result": "419664190890712"},
|
||||||
|
{"name": "image-006.jpg", "result": "412056690699101"},
|
||||||
|
{"name": "image-007.jpg", "result": "419204531290601"},
|
||||||
|
{"name": "image-008.jpg", "result": "419871600890101"},
|
||||||
|
{"name": "image-009.jpg", "result": "978054466825652495"},
|
||||||
|
{"name": "image-010.jpg", "result": "900437801102701"}
|
||||||
|
];
|
||||||
|
|
||||||
|
testSet.forEach(function(sample) {
|
||||||
|
sample.format = "ean_13";
|
||||||
|
});
|
||||||
|
_runTestSet(testSet, config);
|
||||||
|
});
|
||||||
|
|
||||||
describe("Code128", function() {
|
describe("Code128", function() {
|
||||||
var config = {
|
var config = {
|
||||||
inputStream: {
|
inputStream: {
|
||||||
|
|||||||