Skip to content

v0.3.0 - Thumbnail API, Access Modes, Hardening

Latest

Choose a tag to compare

@ivantokar ivantokar released this 15 Jul 10:29

Added

  • Thumbnail API backed by vips_thumbnail: Hokusai.thumbnail(from:width:options:) (file path and buffer) and HokusaiImage.thumbnail(width:options:), with ThumbnailOptions (height bound, centre/attention/entropy smart crop, noRotate) and EXIF auto-rotation by default.
  • LoadOptions with AccessMode (random/sequential) exposing the libvips access-pattern hint, plus the .sequential preset.
  • Hokusai.vipsConcurrency for the libvips thread pool size.
  • hokusai thumbnail CLI command and hokusai benchmark thumbnail.
  • HokusaiError.invalidDimensions with centralized dimension validation across all thumbnail entry points and the CLI.
  • GitHub Actions CI on macOS and Linux (Swift 6.0/6.1); test suite expanded to 62 tests with realistic fixtures.

Changed

  • Breaking: Hokusai.image(from:) is no longer async (it always performed synchronous work). Replace try await Hokusai.image(...) with try Hokusai.image(...).
  • Hokusai.initialize() is idempotent, thread-safe, and called automatically by loading entry points; Hokusai.shutdown() is a final, advanced process-teardown operation.
  • Buffer loads copy their input bytes — a Data passed to Hokusai no longer needs to outlive the returned image.
  • Tests migrated from XCTest to swift-testing.

Fixed

  • Use-after-free when loading images from buffers (libvips does not copy buffer-loader input).
  • Width-only thumbnails of portrait sources returned a width smaller than requested.
  • libvips error messages were cleared before being read.
  • Corrected access-mode/shrink-on-load documentation and broken README examples.

Requirements

  • libvips >= 8.9, Swift 6.0+, prompt >= 1.1.2 for the CLI target.

Full details in CHANGELOG.md.