mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-27 04:42:35 +00:00
Merge branch 'main' into pr/point_refactor
This commit is contained in:
@@ -143,7 +143,7 @@ impl OneDReader for ITFReader {
|
||||
lengthOK = true;
|
||||
}
|
||||
if !lengthOK {
|
||||
return Err(Exceptions::FormatException(None));
|
||||
return Err(Exceptions::format);
|
||||
}
|
||||
|
||||
let mut resultObject = RXingResult::new(
|
||||
@@ -198,13 +198,9 @@ impl ITFReader {
|
||||
}
|
||||
|
||||
let mut bestMatch = self.decodeDigit(&counterBlack)?;
|
||||
resultString.push(
|
||||
char::from_u32('0' as u32 + bestMatch).ok_or(Exceptions::ParseException(None))?,
|
||||
);
|
||||
resultString.push(char::from_u32('0' as u32 + bestMatch).ok_or(Exceptions::parse)?);
|
||||
bestMatch = self.decodeDigit(&counterWhite)?;
|
||||
resultString.push(
|
||||
char::from_u32('0' as u32 + bestMatch).ok_or(Exceptions::ParseException(None))?,
|
||||
);
|
||||
resultString.push(char::from_u32('0' as u32 + bestMatch).ok_or(Exceptions::parse)?);
|
||||
|
||||
payloadStart += counterDigitPair.iter().sum::<u32>() as usize;
|
||||
}
|
||||
@@ -265,7 +261,7 @@ impl ITFReader {
|
||||
|
||||
if quietCount != 0 {
|
||||
// Unable to find the necessary number of quiet zone pixels.
|
||||
Err(Exceptions::NotFoundException(None))
|
||||
Err(Exceptions::notFound)
|
||||
} else {
|
||||
Ok(())
|
||||
}
|
||||
@@ -282,7 +278,7 @@ impl ITFReader {
|
||||
let width = row.getSize();
|
||||
let endStart = row.getNextSet(0);
|
||||
if endStart == width {
|
||||
return Err(Exceptions::NotFoundException(None));
|
||||
return Err(Exceptions::notFound);
|
||||
}
|
||||
|
||||
Ok(endStart)
|
||||
@@ -377,7 +373,7 @@ impl ITFReader {
|
||||
isWhite = !isWhite;
|
||||
}
|
||||
}
|
||||
Err(Exceptions::NotFoundException(None))
|
||||
Err(Exceptions::notFound)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -406,7 +402,7 @@ impl ITFReader {
|
||||
if bestMatch >= 0 {
|
||||
Ok(bestMatch as u32 % 10)
|
||||
} else {
|
||||
Err(Exceptions::NotFoundException(None))
|
||||
Err(Exceptions::notFound)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user