Skip to content

Commit

Permalink
chore: prepare for release
Browse files Browse the repository at this point in the history
update version to v0.5.5.

fixes: #48
changes name of `image-formats` to `image_formats` to more allign with the naming convention of the library.
  • Loading branch information
hschimke committed Jan 30, 2024
1 parent aa61282 commit 297ea7b
Show file tree
Hide file tree
Showing 33 changed files with 666 additions and 134 deletions.
520 changes: 520 additions & 0 deletions .vscode/launch.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rxing"
version = "0.5.4"
version = "0.5.5"
description="A rust port of the zxing barcode library."
license="Apache-2.0"
repository="https://github.com/rxing-core/rxing"
Expand Down Expand Up @@ -41,10 +41,10 @@ rand = "0.8.5"
criterion = "0.5"

[features]
default = ["image", "client_support", "image-formats"]
default = ["image", "client_support", "image_formats"]
#/// Enable features required for image manipulation and reading.
image = ["dep:image", "dep:imageproc"]
image-formats = [
image_formats = [
"image",
"image/gif",
"image/jpeg",
Expand Down
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,17 @@ All barcode formats are tested and functioning in their current state against cu
| rss-14 | complete | no | yes |
| rss-expanded | complete | no | yes|
| telepen | complete | yes | yes |
| micro qr | complete | no | yes |
| rMQR | complete | no | yes |

Please note that currently UPC/EAN Extension 2/5 is supported.

## Feature Flags
The following feature flags are available:
* `image`: Enable features required for image manipulation and reading.
* `image_formats`: Enabled by default. Compile all `image` crate image format support options.
* `allow_forced_iso_ied_18004_compliance`: Allows the ability to force ISO/IED 18004 compliance. Leave disabled unless specificially needed.
* `client_support`: Enable the client library. This is used for parsing the result of barcodes.
* `svg_write`: Enable support for writing SVG files
* `svg_read`: Enable support for reading SVG files
* `wasm_support`: Make certain changes to support building this module in WASM
Expand All @@ -56,7 +60,7 @@ The following feature flags are available:

This is not used by any of the helper functions, you must specifically use it while setting up a new decoder. The `OtsuLevelBinarizer` is not well tested and it does *not* pass the current test suite. Consider this only if you know why you would want to use it. In many cases, the standard binarizer is likely better. If you have a very specific use case, and you know what your incoming data will resemble, you should consider implementing your own `Binarizer` and using that instead.

The default feature set includes only the `image` feature mentioned above.
The default feature set includes the `image`, `client_support`, and `image_formats` features mentioned above.

## Incomplete
The library has only been thurougly tested with the `BufferedImageLuminanceSource` source format. Using any other
Expand All @@ -82,6 +86,13 @@ fn main() {
```

## Latest Release Notes
* *v0.5.5* -> Add support for rMQR, allows building the library without image_formats, fixes an issue with multiple barcode detection.

New default feature flag `image_formats` enables all of the `image` crates image formats for use.
rMQR support is basic and is most effective on pure-barcodes.
The previous version of the `GenericMultipleBarcodeReader` used the contents of the barcode as they determination of uniquness.
This was incorrect and the new version attempts to elimate duplicates by detecting if they are within one another.

* *v0.5.0* -> Added support for [telepen](https://advanova.co.uk/wp-content/uploads/2022/05/Barcode-Symbology-information-and-History.pdf) thanks to the work of first time contributor [cpwood](https://github.com/cpwood).

This release also adds the ability to exclude building the "client" result parsing features. Currently part of the default
Expand Down
1 change: 1 addition & 0 deletions crates/cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ fn decode_command(
rxing::DecodeHintValue::PureBarcode(*pure_barcode),
);
}

if let Some(character_set) = character_set {
hints.insert(
rxing::DecodeHintType::CHARACTER_SET,
Expand Down
16 changes: 8 additions & 8 deletions src/maxicode/detector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1054,7 +1054,7 @@ mod detector_test {
Binarizer, BufferedImageLuminanceSource,
};

#[cfg(feature = "image-formats")]
#[cfg(feature = "image_formats")]
#[test]
fn mode_1() {
finder_test(
Expand All @@ -1063,7 +1063,7 @@ mod detector_test {
)
}

#[cfg(feature = "image-formats")]
#[cfg(feature = "image_formats")]
#[test]
fn mode_2() {
finder_test(
Expand All @@ -1072,7 +1072,7 @@ mod detector_test {
)
}

#[cfg(feature = "image-formats")]
#[cfg(feature = "image_formats")]
#[test]
fn mode_2_rot90() {
finder_test(
Expand All @@ -1081,7 +1081,7 @@ mod detector_test {
)
}

#[cfg(feature = "image-formats")]
#[cfg(feature = "image_formats")]
#[test]
fn mode3() {
finder_test(
Expand All @@ -1090,7 +1090,7 @@ mod detector_test {
)
}

#[cfg(feature = "image-formats")]
#[cfg(feature = "image_formats")]
#[test]
fn mixed_sets() {
finder_test(
Expand All @@ -1099,7 +1099,7 @@ mod detector_test {
)
}

#[cfg(feature = "image-formats")]
#[cfg(feature = "image_formats")]
#[test]
fn mode4() {
finder_test(
Expand All @@ -1108,7 +1108,7 @@ mod detector_test {
)
}

#[cfg(feature = "image-formats")]
#[cfg(feature = "image_formats")]
#[test]
fn mode5() {
finder_test(
Expand All @@ -1117,7 +1117,7 @@ mod detector_test {
)
}

#[cfg(feature = "image-formats")]
#[cfg(feature = "image_formats")]
#[test]
fn mode6() {
finder_test(
Expand Down
4 changes: 2 additions & 2 deletions src/multi/multi_test_case.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use super::{GenericMultipleBarcodeReader, MultipleBarcodeReader};
* Tests {@link MultipleBarcodeReader}.
*/

#[cfg(feature = "image-formats")]
#[cfg(feature = "image_formats")]
#[test]
fn testMulti() {
// Very basic test for now
Expand Down Expand Up @@ -55,7 +55,7 @@ fn testMulti() {
assert_eq!(&BarcodeFormat::QR_CODE, results[1].getBarcodeFormat());
}

#[cfg(feature = "image-formats")]
#[cfg(feature = "image_formats")]
#[test]
fn testMultiQR() {
// Very basic test for now
Expand Down
2 changes: 1 addition & 1 deletion src/multi/qrcode/qr_code_multi_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ mod multi_qr_code_test_case {
* Tests {@link QRCodeMultiReader}.
*/

#[cfg(feature = "image-formats")]
#[cfg(feature = "image_formats")]
#[test]
fn testMultiQRCodes() {
// Very basic test for now
Expand Down
36 changes: 18 additions & 18 deletions src/oned/rss/expanded/rss_expanded_image_2_binary_test_case.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ use crate::{

use super::bit_array_builder;

#[cfg(feature = "image-formats")]
#[cfg(feature = "image_formats")]
#[test]
fn testDecodeRow2binary1() {
// (11)100224(17)110224(3102)000100
assertCorrectImage2binary("1.png",
" ...X...X .X....X. .XX...X. X..X...X ...XX.X. ..X.X... ..X.X..X ...X..X. X.X....X .X....X. .....X.. X...X...");
}

#[cfg(feature = "image-formats")]
#[cfg(feature = "image_formats")]
#[test]
fn testDecodeRow2binary2() {
// (01)90012345678908(3103)001750
Expand All @@ -53,22 +53,22 @@ fn testDecodeRow2binary2() {
);
}

#[cfg(feature = "image-formats")]
#[cfg(feature = "image_formats")]
#[test]
fn testDecodeRow2binary3() {
// (10)12A
assertCorrectImage2binary("3.png", " .......X ..XX..X. X.X....X .......X ....");
}

#[cfg(feature = "image-formats")]
#[cfg(feature = "image_formats")]
#[test]
fn testDecodeRow2binary4() {
// (01)98898765432106(3202)012345(15)991231
assertCorrectImage2binary(
"4.png", " ..XXXX.X XX.XXXX. .XXX.XX. XX..X... .XXXXX.. XX.X..X. ..XX..XX XX.X.XXX X..XX..X .X.XXXXX XXXX");
}

#[cfg(feature = "image-formats")]
#[cfg(feature = "image_formats")]
#[test]
fn testDecodeRow2binary5() {
// (01)90614141000015(3202)000150
Expand All @@ -78,23 +78,23 @@ fn testDecodeRow2binary5() {
);
}

#[cfg(feature = "image-formats")]
#[cfg(feature = "image_formats")]
#[test]
fn testDecodeRow2binary10() {
// (01)98898765432106(15)991231(3103)001750(10)12A(422)123(21)123456(423)0123456789012
assertCorrectImage2binary("10.png",
" .X.XX..X XX.XXXX. .XXX.XX. XX..X... .XXXXX.. XX.X..X. ..XX...X XX.X.... X.X.X.X. X.X..X.X .X....X. XX...X.. ...XX.X. .XXXXXX. .X..XX.. X.X.X... .X...... XXXX.... XX.XX... XXXXX.X. ...XXXXX .....X.X ...X.... X.XXX..X X.X.X... XX.XX..X .X..X..X .X.X.X.X X.XX...X .XX.XXX. XXX.X.XX ..X.");
}

#[cfg(feature = "image-formats")]
#[cfg(feature = "image_formats")]
#[test]
fn testDecodeRow2binary11() {
// (01)98898765432106(15)991231(3103)001750(10)12A(422)123(21)123456
assertCorrectImage2binary("11.png",
" .X.XX..X XX.XXXX. .XXX.XX. XX..X... .XXXXX.. XX.X..X. ..XX...X XX.X.... X.X.X.X. X.X..X.X .X....X. XX...X.. ...XX.X. .XXXXXX. .X..XX.. X.X.X... .X...... XXXX.... XX.XX... XXXXX.X. ...XXXXX .....X.X ...X.... X.XXX..X X.X.X... ....");
}

#[cfg(feature = "image-formats")]
#[cfg(feature = "image_formats")]
#[test]
fn testDecodeRow2binary12() {
// (01)98898765432106(3103)001750
Expand All @@ -104,7 +104,7 @@ fn testDecodeRow2binary12() {
);
}

#[cfg(feature = "image-formats")]
#[cfg(feature = "image_formats")]
#[test]
fn testDecodeRow2binary13() {
// (01)90012345678908(3922)795
Expand All @@ -114,71 +114,71 @@ fn testDecodeRow2binary13() {
);
}

#[cfg(feature = "image-formats")]
#[cfg(feature = "image_formats")]
#[test]
fn testDecodeRow2binary14() {
// (01)90012345678908(3932)0401234
assertCorrectImage2binary(
"14.png", " ..XX.X.. ........ .X..XXX. X.X.X... XX.XXXXX .XXXX.X. X.....X. X.....X. X.X.X.XX .X...... X...");
}

#[cfg(feature = "image-formats")]
#[cfg(feature = "image_formats")]
#[test]
fn testDecodeRow2binary15() {
// (01)90012345678908(3102)001750(11)100312
assertCorrectImage2binary(
"15.png", " ..XXX... ........ .X..XXX. X.X.X... XX.XXXXX .XXXX.X. ..XX...X .X.....X .XX..... XXXX.X.. XX..");
}

#[cfg(feature = "image-formats")]
#[cfg(feature = "image_formats")]
#[test]
fn testDecodeRow2binary16() {
// (01)90012345678908(3202)001750(11)100312
assertCorrectImage2binary(
"16.png", " ..XXX..X ........ .X..XXX. X.X.X... XX.XXXXX .XXXX.X. ..XX...X .X.....X .XX..... XXXX.X.. XX..");
}

#[cfg(feature = "image-formats")]
#[cfg(feature = "image_formats")]
#[test]
fn testDecodeRow2binary17() {
// (01)90012345678908(3102)001750(13)100312
assertCorrectImage2binary(
"17.png", " ..XXX.X. ........ .X..XXX. X.X.X... XX.XXXXX .XXXX.X. ..XX...X .X.....X .XX..... XXXX.X.. XX..");
}

#[cfg(feature = "image-formats")]
#[cfg(feature = "image_formats")]
#[test]
fn testDecodeRow2binary18() {
// (01)90012345678908(3202)001750(13)100312
assertCorrectImage2binary(
"18.png", " ..XXX.XX ........ .X..XXX. X.X.X... XX.XXXXX .XXXX.X. ..XX...X .X.....X .XX..... XXXX.X.. XX..");
}

#[cfg(feature = "image-formats")]
#[cfg(feature = "image_formats")]
#[test]
fn testDecodeRow2binary19() {
// (01)90012345678908(3102)001750(15)100312
assertCorrectImage2binary(
"19.png", " ..XXXX.. ........ .X..XXX. X.X.X... XX.XXXXX .XXXX.X. ..XX...X .X.....X .XX..... XXXX.X.. XX..");
}

#[cfg(feature = "image-formats")]
#[cfg(feature = "image_formats")]
#[test]
fn testDecodeRow2binary20() {
// (01)90012345678908(3202)001750(15)100312
assertCorrectImage2binary(
"20.png", " ..XXXX.X ........ .X..XXX. X.X.X... XX.XXXXX .XXXX.X. ..XX...X .X.....X .XX..... XXXX.X.. XX..");
}

#[cfg(feature = "image-formats")]
#[cfg(feature = "image_formats")]
#[test]
fn testDecodeRow2binary21() {
// (01)90012345678908(3102)001750(17)100312
assertCorrectImage2binary(
"21.png", " ..XXXXX. ........ .X..XXX. X.X.X... XX.XXXXX .XXXX.X. ..XX...X .X.....X .XX..... XXXX.X.. XX..");
}

#[cfg(feature = "image-formats")]
#[cfg(feature = "image_formats")]
#[test]
fn testDecodeRow2binary22() {
// (01)90012345678908(3202)001750(17)100312
Expand Down
Loading

0 comments on commit 297ea7b

Please sign in to comment.