Merge pull request #37 from davegreco/code39_whitespace_bug

Fixed a logic error in Code 39 that was requiring too much quiet zone.
This commit is contained in:
Aidan Steele 2016-03-30 09:03:54 +11:00
commit fae6addf3b

View File

@ -133,7 +133,7 @@ Ref<Result> Code39Reader::decodeRow(int rowNumber, Ref<BitArray> row) {
int whiteSpaceAfterEnd = nextStart - lastStart - lastPatternSize;
// If 50% of last pattern size, following last pattern, is not whitespace,
// fail (but if it's whitespace to the very end of the image, that's OK)
if (nextStart != end && (whiteSpaceAfterEnd >> 1) < lastPatternSize) {
if (nextStart != end && (whiteSpaceAfterEnd << 1) < lastPatternSize) {
throw NotFoundException();
}