openjpeg_ffi 0.3.1
openjpeg_ffi: ^0.3.1 copied to clipboard
Dart bindings to OpenJPEG for encoding and decoding raw JPEG2000 codestreams — native-assets FFI on native platforms, WebAssembly on web. No manual setup required either way.
0.3.1 #
- Fix:
flutter build web/dart pub getwith native-assets enabled crashed every consumer of this package on the web withBad state: HookConfig.code should only be accessed when building code assets—hook/build.dartreadinput.config.code.targetOSunconditionally, butinput.config.codeonly exists wheninput.config.buildCodeAssetsis true, which it never is for a web target (the web build uses the WASM module from 0.3.0 instead of a native library, so no code asset is built at all). Present since 0.3.0's web support was added; now guarded with an earlyif (!input.config.buildCodeAssets) return;.
0.3.0 #
- Add web support:
decodeJ2k/encodeJ2know also work ondart2jsanddart2wasmweb builds, backed by OpenJPEG compiled to a standalone WebAssembly module (embedded in the package — no separate asset to serve). Callawait initOpenJpegWasm()once before using either function on web (a no-op on native platforms, safe to call unconditionally). See the README's "Web support" section for the setup and its limitations (larger app bundle, no background-isolate offloading, noweb-workerstreaming yet). - Fix Android: every call to
decodeJ2k/encodeJ2kcrashed withdlopen failed: cannot locate symbol "pow", sincehook/build.dartnever linkedlibm(needed by Android's Bionic, unlike the other platforms). Present since 0.1.0 — verified fixed on a real Android emulator; CI still can't catch this class of bug since it only runsdart teston the host, never an actual Android/iOS runtime.
0.2.0 #
- Add
encodeJ2kfor encoding a raw raster to a JPEG2000 codestream (lossless by default, or lossy viacompressionRatio), plusJp2kEncodeException.
0.1.1 #
- Bump
ffigendev dependency to^21.0.0.
0.1.0 #
- Initial release:
decodeJ2kfor decoding raw JPEG2000 codestreams via a vendored OpenJPEG 2.5.4, built throughhook/build.dart(native-assets). Verified via CI on macOS, iOS, Android, Windows, and Linux — no per-platform code needed.