koni_jxl_flutter 0.1.4
koni_jxl_flutter: ^0.1.4 copied to clipboard
Flutter bindings for koni_jxl: display and encode JPEG XL (.jxl) images with a pure Dart codec — no native dependencies, all platforms.
Changelog #
0.1.4 #
JxlImageProvidergainedcacheWidth/cacheHeightfor a reduced-resolution decode straight from the idiomatic provider (wrapping a JXL-backedImageProviderinResizeImagehas no effect, since JXL bytes never reach the engine'sdecodecallback). Pairs withkoni_jxl0.1.4's faster downscale paths (VarDCT DC-only, progressive-DC, and Modular/Squeeze responsive).- Picks up all of
koni_jxl0.1.4: a much stronger lossless encoder (now beats PNG and is within ~2% ofcjxl -e7), ICC output-colour transforms and spot-colour compositing on the decode path, a VarDCT quant-weight fidelity fix, and a SIMD EPF pass-0 (large progressive photos ~2.4× faster to decode).
0.1.3 #
decodeJxlToUiImage/decodeJxlToUiCodec/jxlAwareDecodegainedcacheWidth/cacheHeightparameters, threading through tokoni_jxl0.1.3's reduced-resolutionJxlDecoder.decode. This closes a real gap: wrapping a JXL-backedImageProviderinResizeImagehas no effect on JXL bytes, since they never reach the engine'sdecodecallback (and itsgetTargetSize) thatResizeImagerelies on —jxlAwareDecodenow needs the target size passed explicitly instead.- Float (HDR) sample images now decode and render through
JxlImageProvider/decodeJxlToUiImage(inherited fromkoni_jxl0.1.3); they previously threwJxlUnsupportedException.
0.1.2 #
JxlPagePrefetcher— decodes upcoming pages of a sequential reader (manga chapters, documents, etc.) on background isolates ahead of when they're displayed.setCurrentIndexkeeps a[index - behindCount, index + aheadCount]window decoded or decoding, cancelling in-flight decodes and evicting cached results outside the window as the reader navigates;imageForreturns the decoded image whether or not it was prefetched..fromBytesList/.fromFiles/.fromAssetsconstructors. Cancellation interrupts an in-flight decode within 1-2ms. Falls back to on-demand decode on the web, which has no isolates.- Picked up
koni_jxl0.1.2's decoder correctness fixes and ~18-24% faster real-manga decode (see that package's changelog).
0.1.1 #
decodeJxlToUiCodec— decode to aui.Codec, the shape customImageProviders feed toMultiFrameImageStreamCompleter. Stills yield a single-frame codec; animated files carry their frame durations and loop count. Handles the engine's raw-descriptor lifetime rules internally (frames are extracted before the backing buffers are released, then handed out as clones).jxlAwareDecode(bytes, decode)— the drop-in seam for apps whose providers render mixed formats from one byte source: sniffs JPEG XL by content (looksLikeJxl, re-exported fromkoni_jxl0.1.1) and decodes it here; anything else goes to the engine callback unchanged.JxlImageProvidernow usesdecodeJxlToUiCodec, so animated JPEG XL plays through plainImagewidgets with correct timing and loop count (it previously showed only the first frame).- The whole
koni_jxlAPI is re-exported, so one dependency suffices. - Fixed web builds: every decode/encode helper used
Isolate.run, which throwsUnsupportedErrorunder dart2js/dart2wasm, so the package did not actually work on the web. All heavy work now goes through Flutter'scompute— still a background isolate (with transferred, not copied, result buffers) on native platforms, a plain call on the web, where the decode runs on the UI thread.
0.1.0 #
First release. Flutter bindings for the pure-Dart koni_jxl codec.
JxlImageProvider(.asset/.file/.memory) anddecodeJxlToUiImage— decode.jxlin a background isolate, integrated with Flutter's image cache.decodeJxlAnimationand theJxlAnimationViewwidget — play animated JPEG XL with correct frame timing and loop count.decodeJxlProgressiveand theJxlProgressiveImagewidget — show a blurry 1:8 preview while bytes stream in, then the sharp final image.encodeJxlFromRgba/encodeJxlFromUiImage— lossless JPEG XL encoding in a background isolate.