Added
- Thumbnail API backed by
vips_thumbnail:Hokusai.thumbnail(from:width:options:)(file path and buffer) andHokusaiImage.thumbnail(width:options:), withThumbnailOptions(height bound,centre/attention/entropysmart crop,noRotate) and EXIF auto-rotation by default. LoadOptionswithAccessMode(random/sequential) exposing the libvips access-pattern hint, plus the.sequentialpreset.Hokusai.vipsConcurrencyfor the libvips thread pool size.hokusai thumbnailCLI command andhokusai benchmark thumbnail.HokusaiError.invalidDimensionswith 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 longerasync(it always performed synchronous work). Replacetry await Hokusai.image(...)withtry 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
Datapassed 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.