Skip to content

v0.1.14 — turbojpeg actually usable from Python + Windows CI fix

Latest

Choose a tag to compare

@edgarriba edgarriba released this 19 May 07:22
· 70 commits to main since this release

The headline: turbojpeg is finally reachable from the Python API.

In 0.1.13 we shipped wheels with libjpeg-turbo compiled into the binary, but the Python-facing symbols (kr.io.encode_image_jpegturbo, decode_image_jpegturbo, read_image_jpegturbo, write_image_jpegturbo, ImageEncoder, ImageDecoder) were silently absent because the #[cfg(feature = "turbojpeg")] gates in kornia-py/src/*.rs check kornia-py's own feature flag, not the kornia-io dep's. We had set the dep flag but never activated kornia-py's. 0.1.14 fixes that with default = ["turbojpeg"], so the gates fire on every default build.

Verification: the kornia-py Python test suite that asserts these symbols exist (e.g. test_decode_image_jpegturbo, test_compress_decompress, test_write_read_jpegturbo) is now passing on Linux + macOS + Windows.

Other changes since v0.1.13

  • Windows CI fix: windows-latest GitHub runners no longer ship Visual Studio 2022 (only 2026 Preview), which broke cmake auto-detection. Switched to CMAKE_GENERATOR=Ninja + ilammy/msvc-dev-cmd so the libjpeg-turbo build is VS-version-agnostic.
  • Single source of truth for the turbojpeg feature: dropped the redundant features = ["turbojpeg"] on the kornia-io dep line. Now --no-default-features actually skips the libjpeg-turbo cmake build (was previously always forced on).
  • Pre-commit / rustfmt / toml-fmt CI fixes from the 0.1.12 release flow.

How to use turbojpeg from Python

import kornia_rs as kr

# Fast JPEG encode (libjpeg-turbo SIMD path)
enc = kr.io.ImageEncoder()
jpeg_bytes = enc.encode(img, quality=85)

# Fast JPEG decode
dec = kr.io.ImageDecoder()
arr = dec.decode(jpeg_bytes)

The pure-Rust jpeg-encoder fallback is still used when libjpeg-turbo init fails, so building with --no-default-features continues to work.

Full diff: v0.1.13...v0.1.14