diff --git a/example/static_images.html b/example/static_images.html
index f28c700..3a7372b 100644
--- a/example/static_images.html
+++ b/example/static_images.html
@@ -43,6 +43,7 @@
+
diff --git a/example/static_images.js b/example/static_images.js
index c986425..89b0030 100644
--- a/example/static_images.js
+++ b/example/static_images.js
@@ -1,14 +1,39 @@
$(function() {
var App = {
init: function() {
- Quagga.init(this.state, function() {
+ var config = this.config[this.state.decoder.readers[0]] || this.config.default;
+ config = $.extend(true, {}, config, this.state);
+ Quagga.init(config, function() {
App.attachListeners();
Quagga.start();
});
},
config: {
- reader: "code_128",
- length: 10
+ "default": {
+ inputStream: { name: "Test",
+ type: "ImageStream",
+ length: 10,
+ size: 800
+ },
+ locator: {
+ patchSize: "medium",
+ halfSample: true
+ }
+ },
+ "i2of5_reader": {
+ inputStream: {
+ size: 800,
+ type: "ImageStream",
+ length: 5
+ },
+ locator: {
+ patchSize: "small",
+ halfSample: false
+ }
+ }
+ },
+ getState: function(reader) {
+ return this.config[reader] || this.config.default;
},
attachListeners: function() {
var self = this;
@@ -58,6 +83,7 @@ $(function() {
paths.forEach(function(path) {
var mappedValue;
+
if (typeof self._accessByPath(self.inputMapper, path) === "function") {
mappedValue = self._accessByPath(self.inputMapper, path)(value);
}
@@ -82,10 +108,8 @@ $(function() {
}
},
state: {
- inputStream: { name: "Test",
- type: "ImageStream",
+ inputStream: {
src: "../test/fixtures/code_128/",
- length: 10
},
decoder : {
readers : ["code_128_reader"]
diff --git a/test/fixtures/i2of5/image-010.jpg b/test/fixtures/i2of5/image-010.jpg
deleted file mode 100644
index f59d49d..0000000
Binary files a/test/fixtures/i2of5/image-010.jpg and /dev/null differ
diff --git a/test/fixtures/i2of5/image-011.jpg b/test/fixtures/i2of5/image-011.jpg
index 2204602..f59d49d 100644
Binary files a/test/fixtures/i2of5/image-011.jpg and b/test/fixtures/i2of5/image-011.jpg differ
diff --git a/test/fixtures/i2of5/image-012.jpg b/test/fixtures/i2of5/image-012.jpg
index d54fd85..2204602 100644
Binary files a/test/fixtures/i2of5/image-012.jpg and b/test/fixtures/i2of5/image-012.jpg differ
diff --git a/test/fixtures/i2of5/image-013.jpg b/test/fixtures/i2of5/image-013.jpg
new file mode 100644
index 0000000..d54fd85
Binary files /dev/null and b/test/fixtures/i2of5/image-013.jpg differ