Add error reporting to tests

This commit is contained in:
Steve Cook
2023-03-02 00:06:30 -05:00
parent 70b1ef270f
commit d2ab7de5dd
5 changed files with 52 additions and 35 deletions

View File

@@ -119,22 +119,20 @@ impl MultiFormatReader {
&mut self,
image: &mut BinaryBitmap<B>,
) -> Result<RXingResult> {
if !self.possible_formats.is_empty() {
let res = self.decode_formats(image);
if res.is_ok() {
return res;
}
if matches!(
self.hints.get(&DecodeHintType::ALSO_INVERTED),
Some(DecodeHintValue::AlsoInverted(true))
) {
// Calling all readers again with inverted image
image.get_black_matrix_mut().flip_self();
let res = self.decode_formats(image);
if res.is_ok() {
return res;
}
if matches!(
self.hints.get(&DecodeHintType::ALSO_INVERTED),
Some(DecodeHintValue::AlsoInverted(true))
) {
// Calling all readers again with inverted image
image.get_black_matrix_mut().flip_self();
let res = self.decode_formats(image);
if res.is_ok() {
return res;
}
}
}
Err(Exceptions::NOT_FOUND)
}