Commit graph

2 commits

Author SHA1 Message Date
jedarden
d603e324a4 test(bf-5cnj8): add comprehensive CLI module imports for encryption testing
Enhanced encryption test imports with additional diagnostic types:
- Added DiagInfo import for structured diagnostic parsing
- Added DIAGNOSTIC_CATALOG import for diagnostic validation

Files modified:
- crates/pdftract-cli/tests/test_encryption_errors.rs
- crates/pdftract-cli/tests/test_encryption_unsupported.rs

Both test files now have complete imports:
use pdftract_cli::password;
use pdftract_core::diagnostics::{DiagCode, DiagInfo, Severity, DIAGNOSTIC_CATALOG};

Acceptance criteria:
 CLI module imports added (use statements)
 Imports compile successfully
 Imports match actual crate structure

Closes bf-5cnj8
Verification: notes/bf-5cnj8.md
2026-07-05 18:54:48 -04:00
jedarden
d1dc2280f1 feat(pdftract-27n3): implement border padding, pipeline orchestration, and fixtures
Implement step 5 (white-border padding: 10 px on all sides), wire all
preprocessing steps into the final preprocess(input, ImageSource) ->
GrayImage entry point, and curate fixtures for the three image-source
paths (PhysicalScan / DigitalOrigin / Jbig2).

Changes:
- Add add_border_padding() function: creates (width+20) x (height+20)
  image with 10px white border on all sides
- Add preprocess() pipeline orchestrator: applies deskew, contrast
  normalization, binarization, denoising, and padding in correct order
- Skip contrast, binarization, and denoising for JBIG2 images
- Generate test fixtures for skewed_2deg, uneven_lighting, clean_digital,
  and jbig2_scan scenarios
- Add integration tests for all critical test scenarios
- Add A4-page benchmarks targeting < 500ms for physical/digital, < 200ms
  for JBIG2

Refs:
- Plan section: Phase 5.3 step 5 (line 1878) + critical tests (lines 1882-1885)
- Bead: pdftract-27n3
- Note: notes/pdftract-27n3.md

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-23 21:55:11 -04:00