mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-26 12:22:34 +00:00
Add error reporting to tests
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user