Skip to content

Commit

Permalink
194: Refactoring/Review
Browse files Browse the repository at this point in the history
  • Loading branch information
serratus committed May 22, 2017
1 parent d01cd6d commit 55d2eb9
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 15 deletions.
6 changes: 2 additions & 4 deletions dist/quagga.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/quagga.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions example/file_input.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ <h3>Working with file-input</h3>
<option value="upc">UPC</option>
<option value="upc_e">UPC-E</option>
<option value="codabar">Codabar</option>
<option value="i2of5">ITF</option>
<option value="2of5">2of5</option>
<option value="i2of5">Interleaved 2 of 5</option>
<option value="2of5">Standard 2 of 5</option>
</select>
</label>
<label>
Expand Down
6 changes: 2 additions & 4 deletions lib/quagga.js

Large diffs are not rendered by default.

5 changes: 1 addition & 4 deletions src/reader/2of5_reader.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ var N = 1,
]},
SINGLE_CODE_ERROR: {value: 0.78, writable: true},
AVG_CODE_ERROR: {value: 0.30, writable: true},
MAX_CORRECTION_FACTOR: {value: 5},
FORMAT: {value: "2of5"}
};

Expand All @@ -47,7 +46,6 @@ TwoOfFiveReader.prototype._findPattern = function(pattern, offset, isWhite, tryH
error,
j,
sum,
normalized,
epsilon = self.AVG_CODE_ERROR;

isWhite = isWhite || false;
Expand Down Expand Up @@ -242,8 +240,7 @@ TwoOfFiveReader.prototype._decode = function() {
if (!code) {
return null;
}
if (result.length % 2 !== 0 ||
result.length < 6) {
if (result.length < 5) {
return null;
}

Expand Down

0 comments on commit 55d2eb9

Please sign in to comment.