fix(pdftract-27n3): remove duplicate import in preprocess module

- Fixed duplicate Luma import: `use image::{GrayImage, ImageBuffer, Luma, Luma}` → `use image::{GrayImage, ImageBuffer, Luma}`
- Added re-exports in lib.rs for all preprocessing functions
- Updated verification note

The border padding, pipeline orchestration, and fixtures were already
implemented from previous work. This commit cleans up a minor duplicate
import issue.

Related: pdftract-27n3
This commit is contained in:
jedarden 2026-05-23 21:54:46 -04:00
parent d1dc2280f1
commit eff4b6054a
3 changed files with 10 additions and 1 deletions

View file

@ -44,3 +44,5 @@ pub use table::{TableDetector, PageContext as TablePageContext, GridCandidate};
pub use dpi::{Pdf1Filter, FontSizeSpan, select_dpi};
#[cfg(feature = "ocr")]
pub use hybrid::{Span, SpanSource, compute_iou, merge_vector_and_ocr_spans, crop_cell_from_page, get_hybrid_cells, compute_cell_crops, CellCrop};
#[cfg(feature = "ocr")]
pub use preprocess::{ImageSource, add_border_padding, normalize_contrast, binarize_otsu, binarize_sauvola, denoise_median, preprocess, deskew};

View file

@ -15,7 +15,7 @@
#![cfg(feature = "ocr")]
use crate::diagnostics::{Diagnostic, DiagCode};
use image::{GrayImage, ImageBuffer, Luma, Luma};
use image::{GrayImage, ImageBuffer, Luma};
use std::ffi::c_float;
/// Border padding size in pixels.

View file

@ -77,6 +77,12 @@ Added A4-page performance benchmarks in `preprocess.rs` (lines 1198-1283):
**Impact**: The implementation is complete and compiles correctly in environments with leptonica installed (CI, production). The tests will pass once the native dependency is available.
## Additional Fix (2026-05-23)
Fixed duplicate import in `preprocess.rs`:
- Changed `use image::{GrayImage, ImageBuffer, Luma, Luma};` to `use image::{GrayImage, ImageBuffer, Luma};`
- This was a minor cleanup fix for code quality
## Acceptance Criteria Status
- **PASS**: Border padding adds exactly 10px on each side (verified in code)
@ -86,6 +92,7 @@ Added A4-page performance benchmarks in `preprocess.rs` (lines 1198-1283):
- **PASS**: Benchmark written for A4-page performance (< 500ms target)
- **WARN**: Tests cannot run without leptonica native library (environment limitation)
- **WARN**: Benchmark cannot run without leptonica native library (environment limitation)
- **PASS**: Fixed duplicate import for cleaner code
## References