194: Refactoring/Review

This commit is contained in:
Christoph Oberhofer
2017-05-22 21:47:01 +02:00
parent d01cd6d527
commit 55d2eb971b
5 changed files with 8 additions and 15 deletions
+2 -4
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -51,8 +51,8 @@
<option value="upc">UPC</option> <option value="upc">UPC</option>
<option value="upc_e">UPC-E</option> <option value="upc_e">UPC-E</option>
<option value="codabar">Codabar</option> <option value="codabar">Codabar</option>
<option value="i2of5">ITF</option> <option value="i2of5">Interleaved 2 of 5</option>
<option value="2of5">2of5</option> <option value="2of5">Standard 2 of 5</option>
</select> </select>
</label> </label>
<label> <label>
+2 -4
View File
File diff suppressed because one or more lines are too long
+1 -4
View File
@@ -24,7 +24,6 @@ var N = 1,
]}, ]},
SINGLE_CODE_ERROR: {value: 0.78, writable: true}, SINGLE_CODE_ERROR: {value: 0.78, writable: true},
AVG_CODE_ERROR: {value: 0.30, writable: true}, AVG_CODE_ERROR: {value: 0.30, writable: true},
MAX_CORRECTION_FACTOR: {value: 5},
FORMAT: {value: "2of5"} FORMAT: {value: "2of5"}
}; };
@@ -47,7 +46,6 @@ TwoOfFiveReader.prototype._findPattern = function(pattern, offset, isWhite, tryH
error, error,
j, j,
sum, sum,
normalized,
epsilon = self.AVG_CODE_ERROR; epsilon = self.AVG_CODE_ERROR;
isWhite = isWhite || false; isWhite = isWhite || false;
@@ -242,8 +240,7 @@ TwoOfFiveReader.prototype._decode = function() {
if (!code) { if (!code) {
return null; return null;
} }
if (result.length % 2 !== 0 || if (result.length < 5) {
result.length < 6) {
return null; return null;
} }