Low-level Rust FFI bindings for libvips. Designed to be stable, minimal, and a foundation for higher-level wrappers.
- Docs: https://houseme.github.io/vips-sys/vips_sys/
- Requirement:
libvips >= 8.2(validated on8.17.2) - Goals: reliable builds, cross-platform reuse, in-sync with upstream
- macOS
brew install vips pkg-config- Apple Silicon: ensure
PKG_CONFIG_PATH=/opt/homebrew/lib/pkgconfig
- Debian/Ubuntu
sudo apt-get install -y libvips-dev pkg-config
- Windows (MSVC)
vcpkg install vipsand ensure the environment is visible tocargo
Verify pkg-config --cflags --libs vips works (MSVC links via vcpkg).
static: prefer static linkingdynamic: prefer dynamic linking (default)helpers: minimal helpers for init/shutdown/version
Build-time exports:
LIBVIPS_VERSION: detectedlibvipsversion stringcfg(vips_8_17): enabled when version>= 8.17
use vips_sys::helpers;
fn main() {
helpers::init("vips-sys-example").expect("vips init failed");
let (a, b, c) = helpers::version();
println!("libvips version: {}.{}.{}", a, b, c);
helpers::shutdown();
}Cargo:
[dependencies]
vips-sys = { version = "0.1.3-beta.2", features = ["helpers"] }This crate uses bindgen:
- Include paths from
pkg-configand pass toclang layout_testsdisabled,rustified_enum(".*")enabled- Comments disabled to avoid doctest noise
- Some items blocklisted for portability
Environment:
PKG_CONFIG_PATH: path forvips.pcLIBVIPS_NO_BINDGEN: skip bindgen and reuse generated outputBINDGEN_EXTRA_CLANG_ARGS: extra-Ior flagsLIBCLANG_PATH: path tolibclangif needed
- Not found
vips:- Install
libvipsandpkg-config(orvcpkgon Windows) - Check
PKG_CONFIG_PATH
- Install
- Bindgen failed:
- Set
LIBCLANG_PATH, or add include dirs viaBINDGEN_EXTRA_CLANG_ARGS
- Set
- Static linking on macOS:
- Prefer dynamic linking due to Homebrew constraints
See CHANGELOG.md.