mirror of
https://github.com/zxing/zxing.git
synced 2024-11-09 20:44:03 -08:00
Port additional Issue 1776 changes
git-svn-id: https://zxing.googlecode.com/svn/trunk@2890 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
9a6ac33760
commit
7606df6da0
|
@ -434,6 +434,8 @@ Ref<Result> Code128Reader::decodeRow(int rowNumber, Ref<BitArray> row) {
|
|||
|
||||
}
|
||||
|
||||
int lastPatternSize = nextStart - lastStart;
|
||||
|
||||
// Check for ample whitespace following pattern, but, to do this we first need to remember that
|
||||
// we fudged decoding CODE_STOP since it actually has 7 bars, not 6. There is a black bar left
|
||||
// to read off. Would be slightly better to properly read. Here we just skip it:
|
||||
|
@ -469,7 +471,7 @@ Ref<Result> Code128Reader::decodeRow(int rowNumber, Ref<BitArray> row) {
|
|||
}
|
||||
|
||||
float left = (float) (startPatternInfo[1] + startPatternInfo[0]) / 2.0f;
|
||||
float right = (float) (nextStart + lastStart) / 2.0f;
|
||||
float right = lastStart + lastPatternSize / 2.0f;
|
||||
|
||||
int rawCodesSize = rawCodes.size();
|
||||
ArrayRef<char> rawBytes (rawCodesSize);
|
||||
|
|
|
@ -161,7 +161,7 @@ Ref<Result> Code39Reader::decodeRow(int rowNumber, Ref<BitArray> row) {
|
|||
}
|
||||
|
||||
float left = (float) (start[1] + start[0]) / 2.0f;
|
||||
float right = (float) (nextStart + lastStart) / 2.0f;
|
||||
float right = lastStart + lastPatternSize / 2.0f;
|
||||
|
||||
ArrayRef< Ref<ResultPoint> > resultPoints (2);
|
||||
resultPoints[0] =
|
||||
|
|
|
@ -96,6 +96,12 @@ Ref<Result> Code93Reader::decodeRow(int rowNumber, Ref<BitArray> row) {
|
|||
nextStart = row->getNextSet(nextStart);
|
||||
} while (decodedChar != '*');
|
||||
result.resize(result.length() - 1); // remove asterisk
|
||||
|
||||
// Look for whitespace after pattern:
|
||||
int lastPatternSize = 0;
|
||||
for (int i = 0, e = theCounters.size(); i < e; i++) {
|
||||
lastPatternSize += theCounters[i];
|
||||
}
|
||||
|
||||
// Should be at least one more black module
|
||||
if (nextStart == end || !row->get(nextStart)) {
|
||||
|
@ -114,7 +120,7 @@ Ref<Result> Code93Reader::decodeRow(int rowNumber, Ref<BitArray> row) {
|
|||
Ref<String> resultString = decodeExtended(result);
|
||||
|
||||
float left = (float) (start[1] + start[0]) / 2.0f;
|
||||
float right = (float) (nextStart + lastStart) / 2.0f;
|
||||
float right = lastStart + lastPatternSize / 2.0f;
|
||||
|
||||
ArrayRef< Ref<ResultPoint> > resultPoints (2);
|
||||
resultPoints[0] =
|
||||
|
|
Loading…
Reference in a new issue