mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-25 20:02:34 +00:00
Merge pull request #41 from rxing-core/client_build_optional
feat: make client builds optional
This commit is contained in:
@@ -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"]
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[cfg(feature = "client_support")]
|
||||
use crate::{
|
||||
client::result::{ExpandedProductParsedRXingResult, ParsedClientResult},
|
||||
common::GlobalHistogramBinarizer,
|
||||
@@ -42,7 +43,7 @@ use crate::{
|
||||
* @author Pablo Orduña, University of Deusto (pablo.orduna@deusto.es)
|
||||
* @author Eduardo Castillejo, University of Deusto (eduardo.castillejo@deusto.es)
|
||||
*/
|
||||
|
||||
#[cfg(feature = "client_support")]
|
||||
#[test]
|
||||
fn testDecodeRow2result2() {
|
||||
// (01)90012345678908(3103)001750
|
||||
@@ -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}");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user