Commit 391018ba authored by Jojo Boulix's avatar Jojo Boulix

Barcode decoder: if several codes are found, select the one with best quality.

parent c9e3a5b0
Pipeline #86840524 passed with stage
in 12 minutes and 53 seconds
......@@ -58,6 +58,10 @@ sub decode_from_path {
my $s = $result->{source}->{index}->{symbol};
if ($s) {
my $best = $s->[0];
for my $i ( 1 .. $#{$s} ) {
$best = $s->[$i]
if ( $s->[$i]->{quality} > $best->{quality} );
}
$r = {
ok => 1,
status => "$best->{type} Q:$best->{quality}",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment