Skip to content

Commit

Permalink
test: Add tests for some GS1 DataBar variants
Browse files Browse the repository at this point in the history
  • Loading branch information
hangy committed Aug 29, 2023
1 parent 265cc0d commit fdb84b7
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/ProductOpener/Images.pm
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ sub scan_code ($file) {

if (not(defined $code)) {
my $decoder = Imager::zxing::Decoder->new();
$decoder->set_formats("DataMatrix");
$decoder->set_formats("DataMatrix|QRCode|MicroQRCode|DataBar|DataBarExpanded");

my $imager = Imager->new();
$imager->read(file => $file)
Expand Down
4 changes: 3 additions & 1 deletion tests/unit/images.t
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ my @scan_code_tests = (
["02_upc_e.jpg", "01234565"],
["03_itf_13.jpg", "0012345123456"],
["04_gs1_128.jpg", "4044782317112"],
["05_gs1_databar_omni.jpg", "1234567890128"],
["05_gs1_databar_omni.jpg", "5010029000214"],
["07_gs1_databar_stacked.jpg", "5010029000214"],
["08_gs1_databar_stacked_omni.jpg", "5010029000214"],
["37_gs1_datamatrix.jpg", "0725272730706"],
["43_gs1_qrcode_digital_link.jpg", "9506000134369"],
["52_gs1_datamatrix_digital_link.jpg", "5010029000214"]
Expand Down
Binary file modified tests/unit/inputs/images/05_gs1_databar_omni.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit fdb84b7

Please sign in to comment.