Files
MetaCrate/crates/libremetaverse-openjpeg
Chili Palmer b2a060d3c6
Some checks failed
Native code generation / deterministic (ubuntu-latest) (push) Successful in 1m56s
Imaging and meshing gate / native (ubuntu-latest) (push) Failing after 2m49s
JPEG 2000 feature / linux (push) Failing after 1m0s
Skia feature / linux (push) Failing after 1m38s
Native code generation / deterministic (macos-latest) (push) Has been cancelled
Native code generation / deterministic (windows-latest) (push) Has been cancelled
Imaging and meshing gate / native (macos-latest) (push) Has been cancelled
Imaging and meshing gate / native (windows-latest) (push) Has been cancelled
JPEG 2000 feature / macos (push) Has been cancelled
JPEG 2000 feature / windows (push) Has been cancelled
Skia feature / macos (push) Has been cancelled
Skia feature / windows (push) Has been cancelled
Document optional codecs and raise MSRV to 1.96
2026-08-09 06:53:05 +00:00
..

MetaCrate OpenJPEG adapter

This private crate is the unsafe implementation boundary for MetaCrate's optional jpeg2000 feature. Its public surface is safe Rust: native handles, callbacks, and OpenJPEG image structures never cross into the imaging API. The adapter uses checked arithmetic and bounded memory streams, validates header dimensions and component counts before decoded sample-plane allocation, and copies decoded samples into owned Rust vectors.

Native prerequisite

OpenJPEG 2.5.4 or newer is required. Versions 2.5.1 through 2.5.3 are not accepted because they are affected by CVE-2025-54874. No bindgen or libclang installation is needed; the crate contains the minimal public ABI declarations used by the adapter.

  • Linux and other Unix targets: install OpenJPEG development headers/libraries and pkg-config; pkg-config --modversion libopenjp2 must report 2.5.4 or newer.
  • macOS: install openjpeg and pkg-config (for example with Homebrew). This is the same system-library path used on Linux; no Apple-only API is used.
  • Windows MSVC: install openjpeg with vcpkg and expose VCPKG_ROOT to Cargo. Use the triplet matching the Rust target and deploy the resulting OpenJPEG DLL beside the application or on its normal DLL search path when using a dynamic triplet.

Enable the adapter with --features jpeg2000 on either libremetaverse-imaging or the umbrella libremetaverse crate. Without that feature, neither the build script nor native library discovery runs.

License and redistribution

OpenJPEG is BSD-2-Clause licensed. MetaCrate discovers an installation supplied by the builder and does not redistribute OpenJPEG source or binaries. A product that redistributes an OpenJPEG shared or static library must also satisfy the OpenJPEG license's copyright and notice requirements. The ABI declarations in this crate follow OpenJPEG's public openjpeg.h; MetaCrate's adapter code is licensed under the repository's BSD-3-Clause license.