Skip to content

feat(j2k): add exact deep region reduction - #70

Merged
jcwal1516 merged 3 commits into
mainfrom
agent/issue-66-deep-region-reduction
Aug 4, 2026
Merged

feat(j2k): add exact deep region reduction#70
jcwal1516 merged 3 commits into
mainfrom
agent/issue-66-deep-region-reduction

Conversation

@jcwal1516

Copy link
Copy Markdown
Member

Summary

  • add an exact JPEG 2000 power-of-two region reduction API below the shared 1/8 ceiling
  • preserve decoder settings and warnings while rejecting unrepresentable or unavailable resolution levels
  • validate main-header and tile-part COC overrides against the minimum component ladder
  • cover 1/8 parity, 1/16 and 1/32 tiled crops, skinny geometry, overflow, and lenient recovery
  • update README and generated public API review evidence

Motivation

Large JPEG 2000 codestreams can carry resolution ladders deeper than the DCT-compatible shared Downscale enum. Decoding the exact lower ladder avoids doing unnecessary higher-resolution work before application resampling.

Fixes #66.

Thanks @CarlAllenn for identifying this use case and proposing the J2K-specific power-of-two API shape in #66.

Validation

  • cargo xtask fmt
  • cargo xtask clippy
  • cargo xtask clippy-strict
  • cargo xtask test
  • cargo xtask doc
  • cargo xtask repo-lint
  • cargo xtask stable-api
  • cargo xtask semver
  • cargo xtask unsafe-audit

cargo xtask panic-surface reports the existing macOS baseline mismatch of 52 expect_used sites against 50. The same result reproduces from a pristine archive of origin/main; this change adds no production expect calls.

@jcwal1516
jcwal1516 merged commit 85e7e29 into main Aug 4, 2026
22 of 24 checks passed
@jcwal1516
jcwal1516 deleted the agent/issue-66-deep-region-reduction branch August 4, 2026 02:51
CarlAllenn added a commit to monumental-archive/iiif-server that referenced this pull request Aug 4, 2026
…78)

* chore: repoint j2k pin from fork to upstream main (all fixes merged)

All three fixes the fork pin carried are now merged upstream:
frames-sg/j2k#63 (region IDWT), frames-sg/j2k#65 (tile skip), and
frames-sg/j2k#70 (deep region reduction, the maintainer's implementation
of the API proposed in frames-sg/j2k#66). No crates.io release carries
them yet — v0.8.0 predates the merges — so the [patch.crates-io]
section stays, now pointing at upstream rev 85e7e29.

Call-site changes: upstream kept the proposed public signature
decode_region_scaled_pow2_into unchanged, but did not expose the fork's
Rect::scaled_covering_denominator helper; jp2.rs now computes the
covering rect locally. j2k version requirement bumped 0.7 -> 0.8.

Validated: task ci green; spike2 differential goldens 6/6 (lossless
bit-exact vs OpenJPEG, lossy within tolerance, HTJ2K bit-exact);
codec_masters 9/9.

Refs #21.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(ci): allow deps.dev and scorecards egress for dependency review

The dependency-review action fetches license data from api.deps.dev and
OpenSSF Scorecard data from api.securityscorecards.dev; both were
blocked by the egress allowlist, failing the job with a bare
'fetch failed' (observed in the harden-runner agent log as
'domain not allowed'). Allowlist derived from the audit run per
issue #6 canon.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* chore: nudge CI (empty)

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

API shape: region decode below 1/8 — the Downscale cap is DCT geometry, not a wavelet limit

1 participant