pdftract/crates/pdftract-core/src/decoder
jedarden 4ba4687a36
Some checks are pending
Schema Generation Validation / Validate JSON Schema (push) Waiting to run
Schema Generation Validation / Validate JSON Syntax (push) Waiting to run
feat(pdftract-36glh): implement JPXDecode passthrough with JP2 validation
Implements JPEG2000 (JPX) passthrough filter per Phase 1.5:

- JP2 box magic validation (12-byte signature check)
- STREAM_INVALID_JPX diagnostic for raw J2K/corrupt data
- OCR_JPX_UNSUPPORTED diagnostic when full-render+libopenjp2 unavailable
- Runtime libopenjp2 detection (pkg-config + ldconfig fallback)
- Passthrough behavior (raw bytes unchanged)

Module: crates/pdftract-core/src/decoder/jpx.rs
Stream integration: JpxStreamDecoder in parser/stream.rs

Acceptance criteria:
- JP2-wrapped JPX with full-render → passthrough, no diagnostic
- JP2-wrapped JPX without full-render → OCR_JPX_UNSUPPORTED
- Raw J2K codestream → STREAM_INVALID_JPX + passthrough
- Round-trip test coverage (unit tests validate JP2 signature)

Per plan EC-12: emits diagnostic when neither full-render nor
libopenjp2 is available, alerting Phase 5.2 OCR pipeline.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-05-28 05:11:19 -04:00
..
jbig2.rs fix(pdftract-2sswr): add Default impl for PageDict to fix JBIG2 compilation 2026-05-28 04:44:45 -04:00
jpx.rs feat(pdftract-36glh): implement JPXDecode passthrough with JP2 validation 2026-05-28 05:11:19 -04:00
mod.rs feat(pdftract-36glh): implement JPXDecode passthrough with JP2 validation 2026-05-28 05:11:19 -04:00