Files
MetaCrate/crates/libremetaverse-openjpeg
Chili Palmer c9a1170a27
Some checks failed
API and SemVer surface / api-surface (push) Failing after 1m34s
Native code generation / deterministic (push) Has been cancelled
Concurrency and resource soak audit / soak (push) Has been cancelled
Documentation / documentation (push) Has been cancelled
performance evidence / audit (push) Has been cancelled
First release candidate / non-fuzz-release-gate (push) Has been cancelled
Release platform and feature matrix / audit (push) Has been cancelled
Release platform and feature matrix / matrix (false, linux-stable-minimal, x86_64-unknown-linux-gnu, stable) (push) Has been cancelled
Release platform and feature matrix / matrix (false, macos-stable-portable, x86_64-apple-darwin, stable) (push) Has been cancelled
Release platform and feature matrix / matrix (false, windows-stable-portable, x86_64-pc-windows-gnu, stable) (push) Has been cancelled
Release platform and feature matrix / matrix (true, linux-msrv-portable, x86_64-unknown-linux-gnu, 1.96.0) (push) Has been cancelled
Release platform and feature matrix / matrix (true, linux-stable-default, x86_64-unknown-linux-gnu, stable) (push) Has been cancelled
Release platform and feature matrix / matrix (true, linux-stable-features, x86_64-unknown-linux-gnu, stable) (push) Has been cancelled
Release platform and feature matrix / matrix (true, linux-stable-release-surface, x86_64-unknown-linux-gnu, stable) (push) Has been cancelled
Dependency and supply-chain audit / audit (push) Has been cancelled
Native release artifact audit / audit (push) Has been cancelled
Imaging and meshing gate / native (push) Failing after 53s
JPEG 2000 feature / linux (push) Successful in 2m49s
Native Rust workspace compile / compile (push) Failing after 59s
Skia feature / linux (push) Has been cancelled
Complete first release candidate audit (#107)
2026-08-12 14:44:28 +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.