Files
MetaCrate/crates/libremetaverse-openjpeg
Chili Palmer d08b59c9a9
Some checks failed
API and SemVer surface / api-surface (push) Failing after 13m8s
Native code generation / deterministic (push) Failing after 2m8s
Concurrency and resource soak audit / soak (push) Failing after 6m39s
Imaging and meshing gate / native (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
Documentation / documentation (push) Has been cancelled
Native Rust workspace compile / compile (push) Has been cancelled
Dependency and supply-chain audit / audit (push) Has been cancelled
JPEG 2000 feature / linux (push) Successful in 2m46s
Skia feature / linux (push) Successful in 31m0s
Audit public API and SemVer surface (#103)
2026-08-12 01:35:26 +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.