Skip to content

Commit

Permalink
Merge pull request #41 from rxing-core/client_build_optional
Browse files Browse the repository at this point in the history
feat: make client builds optional
  • Loading branch information
hschimke authored Jan 2, 2024
2 parents 1f5ec8e + 2ac70a0 commit e04354c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ rand = "0.8.5"
criterion = "0.5"

[features]
default = ["image"]
default = ["image", "client_support"]
#/// Enable features required for image manipulation and reading.
image = ["dep:image", "dep:imageproc"]

Expand All @@ -67,6 +67,9 @@ serde = ["dep:serde"]
#/// Adds otsu binarizer support using imageproc
otsu_level = ["image"]

#/// Adds "client" features do decode many common data formats found in barcodes
client_support = []

[workspace]
members = [
"crates/one-d-proc-derive",
Expand Down
5 changes: 4 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@
#![allow(non_camel_case_types)]

pub mod aztec;
pub mod client;

pub mod common;
mod exceptions;
pub mod maxicode;
pub mod qrcode;

#[cfg(feature = "client_support")]
pub mod client;

use std::{collections::HashMap, rc::Rc};

pub use exceptions::Exceptions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

use std::collections::HashMap;

#[cfg(feature = "client_support")]
use crate::{
client::result::{ExpandedProductParsedRXingResult, ParsedClientResult},
common::GlobalHistogramBinarizer,
Expand All @@ -42,7 +43,7 @@ use crate::{
* @author Pablo Orduña, University of Deusto ([email protected])
* @author Eduardo Castillejo, University of Deusto ([email protected])
*/

#[cfg(feature = "client_support")]
#[test]
fn testDecodeRow2result2() {
// (01)90012345678908(3103)001750
Expand All @@ -67,6 +68,7 @@ fn testDecodeRow2result2() {
assertCorrectImage2result("2.png", expected);
}

#[cfg(feature = "client_support")]
fn assertCorrectImage2result(fileName: &str, expected: ExpandedProductParsedRXingResult) {
let path = format!("test_resources/blackbox/rssexpanded-1/{fileName}");

Expand Down

0 comments on commit e04354c

Please sign in to comment.