Skip to content

chore(openjpeg): update OpenJPEG submodule to upstream v2.5.4 - #78

Merged
wayfarer3130 merged 6 commits into
mainfrom
chore/openjpeg-submodule-2.5.4
Sep 9, 2026
Merged

chore(openjpeg): update OpenJPEG submodule to upstream v2.5.4#78
wayfarer3130 merged 6 commits into
mainfrom
chore/openjpeg-submodule-2.5.4

Conversation

@sedghi

@sedghi sedghi commented Jul 9, 2026

Copy link
Copy Markdown
Member

Third codec submodule upgrade (after openjph #76, charls #77).

Bumps packages/openjpeg/extern/openjpeg from 2d606701 (~2.5.0-era, Oct 2022) to upstream OpenJPEG v2.5.4 (2025-09-20). Fork PR: cornerstonejs/openjpeg#3.

  • No custom patches — clean version advance (fork had zero divergence).
  • Same-minor-line jump (2.5.0 → 2.5.4), so API drift against our openjpeg glue should be small — but CI is the check.
  • No Debug-build issue (openjpeg builds optimized by default).

CI validates compile against our glue + byte-identical pixel goldens + dist-size. Not built locally; iterating on CI. Not for merge.

Update 2026-09-09 (minor change)

This push adds two commits. Neither commit changes the OpenJPEG submodule pointer, and neither commit changes the dist-size baseline.

  1. fb85c65 merges origin/main into this branch. The merge brings in d546620 chore(release): publish. The merge changes 5 files: two CHANGELOG.md files, two package.json files, and pnpm-lock.yaml. The merge touches no submodule.

  2. 3e34c93 adds build-libjpeg to two files: packages/libjpeg-turbo-8bit/.gitignore and packages/libjpeg-turbo-12bit/.gitignore.

Why the ignore rule is in this pull request

A native cmake command writes a build-libjpeg/ directory. The directory holds 6.4 MB of output in the 8-bit package, and 3.5 MB in the 12-bit package. Git tracked neither directory, because build.sh uses the name build/, and that name is the only name that the two ignore files held.

Each package ignores its own build output in its own .gitignore file. Therefore this commit extends those two files, and adds no rule to the root .gitignore file.

The reason for the rule is a possible git add -A, and not disk space. A submodule pointer in a work tree can be at an older commit than the branch records, if an upgrade of that submodule is in progress. An untracked 9.9 MB of cmake output can then go into a commit together with a silent downgrade of a submodule.

The maintainer asked for this rule in this pull request, and asked for no separate pull request.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores

    • Updated build artifact handling for JPEG packages.
    • Refreshed the OpenJPEG component to a newer revision.
    • Updated recorded JavaScript and WebAssembly distribution size measurements.
  • Impact

    • No changes to exported APIs or documented end-user functionality.

Advances from 2d606701 (~2.5.0-era, Oct 2022) to upstream v2.5.4 (2025-09-20).
No custom fork patches (clean version advance). Fork PR: cornerstonejs/openjpeg.
CI is the first build/validation of v2.5.4 against our glue.
@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 9f8e576a-f698-46c2-80b3-91431cd57c42

📥 Commits

Reviewing files that changed from the base of the PR and between d546620 and 3e34c93.

📒 Files selected for processing (4)
  • packages/libjpeg-turbo-12bit/.gitignore
  • packages/libjpeg-turbo-8bit/.gitignore
  • packages/openjpeg/extern/openjpeg
  • tools/dist-size/baseline.json

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The changes add build-libjpeg ignore rules, update the OpenJPEG submodule pointer, and refresh OpenJPEG JavaScript and WebAssembly size baselines.

Changes

OpenJPEG build updates

Layer / File(s) Summary
Build output ignore rules
packages/libjpeg-turbo-12bit/.gitignore, packages/libjpeg-turbo-8bit/.gitignore
Both packages now ignore the build-libjpeg directory.
OpenJPEG reference and size baselines
packages/openjpeg/extern/openjpeg, tools/dist-size/baseline.json
The OpenJPEG submodule pointer changed, and the raw and gzip baselines for OpenJPEG JavaScript and WebAssembly artifacts were updated.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to 3e34c

This updates OpenJPEG and refreshes its generated artifact size baselines; validated builds and decoding outputs indicate no remaining merge-readiness risk.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the primary change: updating the OpenJPEG submodule to upstream v2.5.4.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/openjpeg-submodule-2.5.4

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codspeed-hq

codspeed-hq Bot commented Jul 9, 2026

Copy link
Copy Markdown

Merging this PR will regress 1 benchmark

⚡ 1 improved benchmark
❌ 1 regressed benchmark
✅ 65 untouched benchmarks
⏩ 66 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
JPEG XL Lossless colour (.110) 181.7 ms 297.5 ms -38.94%
encode to JPEG XL lossy d=1.0 (.112) 1,503.7 ms 875.7 ms +71.71%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing chore/openjpeg-submodule-2.5.4 (3e34c93) with main (70030e0)2

Open in CodSpeed

Footnotes

  1. 66 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

  2. No successful run was found on main (d546620) during the generation of this report, so 70030e0 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@sedghi

sedghi commented Jul 9, 2026

Copy link
Copy Markdown
Member Author

Status: green except dist-size (small, expected size growth)

openjpeg v2.5.4 (from ~2.5.0-era, Oct 2022). All real checks pass: build, test, browser-smoke, CodSpeed. No build fixes, no glue changes — clean same-minor-line advance, no custom patches. Decode output byte-identical (goldens pass).

The one red — dist-size — is a modest, genuine size increase from ~3 years of upstream 2.5.x patches:

  • openjpegjs.js +0.9% raw / +1.1% gzip
  • openjpegjs_decode.js +1.4% / +1.8%
  • openjpegwasm.wasm +0.9% / +1.3%

Not a bug — a re-baseline decision. This fits the "modest growth for currency/stability" bar.

Fork PR: cornerstonejs/openjpeg#3 — MERGEABLE.

Actions to merge

  1. Merge fork openjpeg#3.
  2. Re-baseline dist-size: gh run download <this-PR-run-id> --pattern 'dist-*' -D tmp/ && node tools/dist-size/check.js --update --artifacts tmp/ && commit (scoped to openjpeg's entries), then dist-size goes green.
  3. Merge this PR.

jbocce
jbocce previously approved these changes Sep 8, 2026

@jbocce jbocce left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merged in main. Tested in most recent cornerstone3D main (2189b0169e31f8120bdbb99e6d3af323540483fd) and OHIF master (8889c7514574aa837b8f5bc40eee29e8206b0c12) using viewer-testdata https://github.com/OHIF/viewer-testdata/blob/master/dcm/colorEncode/jpeg2000-lossless.dcm and https://github.com/OHIF/viewer-testdata/blob/master/dcm/grayEncode/jpeg2000-lossless.dcm

Also tested using cornerstone3D example dicomimageloaderwadouri

wayfarer3130 and others added 2 commits September 8, 2026 15:35
OpenJPEG 2.5.4 is genuinely larger than the 2.5.x build the baseline
recorded. The dist-size job reported 8 regressions, all in this package,
from run 34269973607:

  openjpegjs.js              737.8 -> 746.5 KiB raw   (+1.18%)
                             195.0 -> 197.9 KiB gzip  (+1.50%)
  openjpegjs_decode.js       529.0 -> 537.5 KiB raw   (+1.62%)
                             136.4 -> 139.3 KiB gzip  (+2.12%)
  openjpegwasm.wasm          359.9 -> 364.2 KiB raw   (+1.20%)
                             124.5 -> 126.5 KiB gzip  (+1.63%)
  openjpegwasm_decode.wasm   249.9 -> 254.2 KiB raw   (+1.74%)
                             82.3 ->  84.3 KiB gzip   (+2.42%)

Scoped to openjpeg, following bdd25d6. A bare `--update` rewrites all
eight packages, and this run carried incidental drift in every one of
them -- charls, openjphjs and libjpeg-turbo-12bit within 0.12%,
libjpeg-turbo-8bit slightly smaller, and the two pure-JS packages up
30 bytes each on a ~1 KiB file. Every one of those passed the tolerance
check as `ok`, so folding them in would absorb drift no reviewer asked
about and bury the change that matters. Only openjpeg's ten entries move
here.

Verified: node tools/dist-size/check.js --artifacts <run 34269973607
dists> reports PASS, 0 size regressions.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@wayfarer3130

Copy link
Copy Markdown
Contributor

Added: a new dist-size baseline for openjpeg

I merged origin/main (c9ed03f), and then I pushed one more commit (a561471). The second commit changes tools/dist-size/baseline.json only.

dist-size failed on c9ed03f. OpenJPEG 2.5.4 is larger than the version that the baseline recorded. The job reported 8 size regressions, and all 8 regressions are in this package:

artifact raw gzip
openjpegjs.js 737.8 to 746.5 KiB (+1.18%) 195.0 to 197.9 KiB (+1.50%)
openjpegjs_decode.js 529.0 to 537.5 KiB (+1.62%) 136.4 to 139.3 KiB (+2.12%)
openjpegwasm.wasm 359.9 to 364.2 KiB (+1.20%) 124.5 to 126.5 KiB (+1.63%)
openjpegwasm_decode.wasm 249.9 to 254.2 KiB (+1.74%) 82.3 to 84.3 KiB (+2.42%)

I made the new numbers from the artifacts of run 34269973607, which is this PR's own CI run. node tools/dist-size/check.js --artifacts <dists> then gave PASS: 0 size regression(s).

The commit changes the openjpeg entries only

A plain --update rewrites all 8 packages. This run also carried a small drift in every other package. charls, openjphjs and libjpeg-turbo-12bit stayed inside 0.12%. libjpeg-turbo-8bit became a few bytes smaller. The two pure-JS packages grew 30 bytes each, on a file of about 1 KiB.

The tolerance check gave ok to each of those changes. Therefore I kept the recorded numbers for those 7 packages. The diff shows the 10 openjpeg entries only. bdd25d6 used the same method for the two libjpeg-turbo packages.

The push removes the approval. Please approve this PR again, or use the administrator bypass.

wayfarer3130 and others added 2 commits September 9, 2026 10:37
A native cmake configure in either libjpeg-turbo package writes a
build-libjpeg/ tree: 6.4 MB under the 8-bit package and 3.5 MB under the
12-bit one. Neither package's .gitignore covered it, because build.sh
uses build/ and that is the only name the ignore files listed.

Both packages already ignore their own build output locally rather than
from the root .gitignore, so extend those two files instead of adding a
root rule.

This is about a stray `git add -A` more than about disk. Both submodule
pointers in this worktree can sit at an OLDER commit than the branch
records while a submodule upgrade is in progress, so an untracked 9.9 MB
of cmake output is exactly the thing that gets swept into a commit next
to a silent submodule downgrade.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@wayfarer3130
wayfarer3130 merged commit 3f12213 into main Sep 9, 2026
17 of 18 checks passed
@wayfarer3130
wayfarer3130 deleted the chore/openjpeg-submodule-2.5.4 branch September 9, 2026 14:58
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.

3 participants