diff --git a/Cargo.toml b/Cargo.toml index 200c404d..91ce482d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rxing" -version = "0.6.0" +version = "0.6.1" description="A rust port of the zxing barcode library." license="Apache-2.0" repository="https://github.com/rxing-core/rxing" @@ -21,7 +21,7 @@ urlencoding = "2.1.3" uriparse = "0.6.4" chrono = "0.4.38" chrono-tz = "0.9" -image = {version = "0.25.1", optional = true, default-features = false} +image = {version = "0.25.2", optional = true, default-features = false} imageproc = {version = "0.25", optional = true} unicode-segmentation = "1.11" codepage-437 = "0.1.0" @@ -30,7 +30,7 @@ num = "0.4.3" svg = {version = "0.17.0", optional = true} resvg = {version = "0.42.0", optional = true, default-features=false} serde = { version = "1.0", features = ["derive", "rc"], optional = true } -thiserror = "1.0.61" +thiserror = "1.0.63" multimap = "0.10.0" bit_reverse = "0.1.8" diff --git a/README.md b/README.md index f987fdcf..989eeeb6 100644 --- a/README.md +++ b/README.md @@ -86,6 +86,28 @@ fn main() { ``` ## Latest Release Notes +* *v0.6.1* -> Initial support for immutable symbol readers. Fixed an issue with the rss_expanded reader. + + Immutable readers: Many 2d readers now implement the `ImmutableReader` trait. This allows them to be called using the + `immutable_decode` and `immutable_decode_with_hints` methods. The corresponding reader need not be declared `mut` in + order to operate correctly. Please note that not all readers support this trait. Most notably: `MultiFormatReader`, + `MultiUseMultiFormatReader`, `FilteredImageReader` and `MultiFormatOneDReader` do not implement `ImmutableReader`. + This is because these readers all require some state be stored. There is ongoing work to reduce this list. + This change also allows individual symbol readers to work in a `Lazy static` context without `unsafe`. + + Example: + ```rust + static LAZY_STATIC_QR_READER: Lazy = Lazy::new(QRCodeReader::default); + + fn main() { + let result = LAZY_STATIC_QR_READER.immutable_decode( + &mut BinaryBitmap::new( + HybridBinarizer::new( + Luma8LuminanceSource::new(luma_data, width, height), + ))); + } + ``` + * *v0.6.0* -> rxing is now thread safe. This is a breaking change if you are using `PointCallback`/`RXingResultPointCallback` or the `Pdf417ExtraMetadata` field of `RXingResultMetadataValue`. In addition there should be some small performance improvements associated with moving away from using `Rc` and `Arc` in many situations throughout the library. * *v0.5.8* -> Performance improvements. Memory Improvements. Added FilteredReader which performs a more complicated operation on images (resizes and closes binary bitmaps) at the expense of some performance. * *v0.5.5* -> Add support for rMQR, allows building the library without image_formats, fixes an issue with multiple barcode detection. diff --git a/crates/cli/Cargo.toml b/crates/cli/Cargo.toml index 12c748d2..4c68fc6d 100644 --- a/crates/cli/Cargo.toml +++ b/crates/cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rxing-cli" -version = "0.1.25" +version = "0.1.26" edition = "2021" description = "A command line interface for rxing supporting encoding and decoding of multiple barcode formats" license="Apache-2.0" @@ -11,7 +11,7 @@ keywords = ["barcode", "barcode_1d", "barcode_2d", "barcode_reader", "barcode_wr [dependencies] clap = { version = "4.5.3", features = ["derive"] } -rxing = {path = "../../", version = "~0.6.0", features = ["image", "svg_read", "svg_write"] } +rxing = {path = "../../", version = "~0.6.1", features = ["image", "svg_read", "svg_write"] } #[profile.release] #debug = true \ No newline at end of file diff --git a/src/filtered_image_reader.rs b/src/filtered_image_reader.rs index 81cf3dd4..264b4fb6 100644 --- a/src/filtered_image_reader.rs +++ b/src/filtered_image_reader.rs @@ -2,7 +2,7 @@ use std::collections::HashMap; use crate::common::{BitMatrix, HybridBinarizer, Result}; use crate::{ - Binarizer, BinaryBitmap, Exceptions, ImmutableReader, Luma8LuminanceSource, LuminanceSource, + Binarizer, BinaryBitmap, Exceptions, Luma8LuminanceSource, LuminanceSource, Reader, }; diff --git a/src/multi/by_quadrant_reader.rs b/src/multi/by_quadrant_reader.rs index 2e6c9c83..d6ba8d4d 100644 --- a/src/multi/by_quadrant_reader.rs +++ b/src/multi/by_quadrant_reader.rs @@ -17,7 +17,7 @@ use std::collections::HashMap; use crate::common::Result; -use crate::{point_f, Binarizer, Exceptions, ImmutableReader, Point, RXingResult, Reader}; +use crate::{point_f, Binarizer, Exceptions, Point, RXingResult, Reader}; /** * This class attempts to decode a barcode from an image, not by scanning the whole image, diff --git a/src/multi_format_reader.rs b/src/multi_format_reader.rs index ff12b08f..a58f5e54 100644 --- a/src/multi_format_reader.rs +++ b/src/multi_format_reader.rs @@ -26,7 +26,7 @@ use crate::{ Binarizer, BinaryBitmap, DecodeHintType, DecodeHintValue, DecodingHintDictionary, Exceptions, RXingResult, Reader, }; -use crate::{ImmutableReader, ONE_D_FORMATS}; +use crate::ONE_D_FORMATS; /** * MultiFormatReader is a convenience class and the main entry point into the library for most uses. diff --git a/src/oned/multi_format_one_d_reader.rs b/src/oned/multi_format_one_d_reader.rs index 9c4e4788..8f2951b9 100644 --- a/src/oned/multi_format_one_d_reader.rs +++ b/src/oned/multi_format_one_d_reader.rs @@ -27,7 +27,6 @@ use super::TelepenReader; use crate::common::Result; use crate::DecodeHintValue; use crate::Exceptions; -use crate::ImmutableReader; use crate::{BarcodeFormat, Binarizer, RXingResult}; /**