Hi!
In my project, I get image dimensions from data parsing using the "image" library and then pass them to this function. If the data is invalid, the function returns 0.
When using the "detect_multiple_in_luma_with_hints" function, if one of the image dimensions is 0, we get "Result::unwrap() on an Err".
Do you think this is correct behavior?
Test:
#[test]
fn test_zero_size_image() {
use rxing::DecodeHints;
let mut hints: DecodeHints =
DecodeHints::default().with(rxing::DecodeHintValue::TryHarder(true));
let data = Vec::new();
rxing::helpers::detect_multiple_in_luma_with_hints(data, 0, 0, &mut hints).unwrap_or_default();
}
Outut:
thread 'test_zero_size_image' (18007) panicked at src/binary_bitmap.rs:147:87:
called `Result::unwrap()` on an `Err` value: IllegalArgumentException("Both dimensions must be greater than 0")
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Hi!
In my project, I get image dimensions from data parsing using the "image" library and then pass them to this function. If the data is invalid, the function returns 0.
When using the "detect_multiple_in_luma_with_hints" function, if one of the image dimensions is 0, we get "
Result::unwrap()on anErr".Do you think this is correct behavior?
Test:
Outut: