add necessary declarations to build wihtout images

This commit is contained in:
Henry Schimke
2023-01-13 10:26:08 -06:00
parent 24cb4d1090
commit 89d02c7ab1
6 changed files with 16 additions and 2 deletions

View File

@@ -37,7 +37,7 @@ java-properties = "1.4.1"
java-rand = "0.2.0" java-rand = "0.2.0"
[features] [features]
default = ["image"] default = []
image = ["dep:image", "dep:imageproc"] image = ["dep:image", "dep:imageproc"]
allow_forced_iso_ied_18004_compliance = [] allow_forced_iso_ied_18004_compliance = []
svg_write = ["dep:svg"] svg_write = ["dep:svg"]

View File

@@ -8,11 +8,14 @@ use std::{
use crate::{ use crate::{
common::{BitMatrix, HybridBinarizer}, common::{BitMatrix, HybridBinarizer},
multi::{GenericMultipleBarcodeReader, MultipleBarcodeReader}, multi::{GenericMultipleBarcodeReader, MultipleBarcodeReader},
BarcodeFormat, BinaryBitmap, BufferedImageLuminanceSource, DecodeHintType, DecodeHintValue, BarcodeFormat, BinaryBitmap, DecodeHintType, DecodeHintValue,
DecodingHintDictionary, Exceptions, Luma8LuminanceSource, MultiFormatReader, RXingResult, DecodingHintDictionary, Exceptions, Luma8LuminanceSource, MultiFormatReader, RXingResult,
Reader, Reader,
}; };
#[cfg(feature="image")]
use crate::BufferedImageLuminanceSource;
#[cfg(feature = "svg_read")] #[cfg(feature = "svg_read")]
pub fn detect_in_svg( pub fn detect_in_svg(
file_name: &str, file_name: &str,
@@ -281,6 +284,8 @@ pub fn save_file(file_name: &str, bit_matrix: &BitMatrix) -> Result<(), Exceptio
String::default() String::default()
}; };
let _ = &ext;
#[cfg(feature = "svg_write")] #[cfg(feature = "svg_write")]
if ext == "svg" { if ext == "svg" {
return save_svg(file_name, bit_matrix); return save_svg(file_name, bit_matrix);

View File

@@ -9,4 +9,5 @@ mod generic_multiple_barcode_reader;
pub use generic_multiple_barcode_reader::*; pub use generic_multiple_barcode_reader::*;
#[cfg(test)] #[cfg(test)]
#[cfg(feature="image")]
mod multi_test_case; mod multi_test_case;

View File

@@ -205,6 +205,7 @@ fn compareRXingResult(a: &RXingResult, b: &RXingResult) -> Ordering {
} }
#[cfg(test)] #[cfg(test)]
#[cfg(feature="image")]
mod multi_qr_code_test_case { mod multi_qr_code_test_case {
/* /*
* Copyright 2016 ZXing authors * Copyright 2016 ZXing authors

View File

@@ -16,19 +16,25 @@ mod rss_expanded_reader;
pub use rss_expanded_reader::*; pub use rss_expanded_reader::*;
#[cfg(test)] #[cfg(test)]
#[cfg(feature="image")]
mod rss_expanded_internal_test_case; mod rss_expanded_internal_test_case;
#[cfg(test)] #[cfg(test)]
#[cfg(feature="image")]
mod rss_expanded_image_2_binary_test_tase; mod rss_expanded_image_2_binary_test_tase;
#[cfg(test)] #[cfg(test)]
#[cfg(feature="image")]
mod rss_expanded_image_2_result_test_case; mod rss_expanded_image_2_result_test_case;
#[cfg(test)] #[cfg(test)]
#[cfg(feature="image")]
mod rss_expanded_image_2_string_test_case; mod rss_expanded_image_2_string_test_case;
#[cfg(test)] #[cfg(test)]
#[cfg(feature="image")]
mod rss_expanded_stacked_internal_test_case; mod rss_expanded_stacked_internal_test_case;
#[cfg(test)] #[cfg(test)]
#[cfg(feature="image")]
mod test_case_util; mod test_case_util;

View File

@@ -9,4 +9,5 @@ mod qr_code_writer;
pub use qr_code_writer::*; pub use qr_code_writer::*;
#[cfg(test)] #[cfg(test)]
#[cfg(feature="image")]
mod QRCodeWriterTestCase; mod QRCodeWriterTestCase;