Repository navigation
Releases
Releases · mefistofelix/auto.js
v0.1.1
Full Changelog: v0.1.0...v0.1.1
v0.1.0
libvips FFI
Native libvips image codecs through Deno FFI.
Architecture:
- Image-library logic lives only in auto.js; native backends exchange raw BGRA8 and import no image codec.
- npm:sharp is a dead literal import for Deno's module graph plus Sharp's JS runtime-platform metadata. sharp.node is never loaded.
- At runtime AutoJS resolves Sharp's platform optional dependency, obtains the libvips shared-library path, and opens it with Deno.dlopen.
- The FFI binding uses fixed-signature GObject/VipsOperation APIs, in the same style as pyvips, avoiding C varargs.
- PNG/WebP use buffer load/save operations. PNG is lossless; WebP uses Q=80 and effort=4.
- wait.image is decoded once in the common layer and passed to the backend as BGRA8.
Why:
- Normal deno compile can embed/materialize the FFI libvips library without --self-extracting or manual --include.
- This avoids Sharp native addon's sibling-DLL loading problem inside Deno's compiled VFS.
- Local 1920x1200 WebP Q80 benchmark: direct libvips FFI ~131.8 ms vs Sharp ~132.6 ms.
- Fresh direct-FFI process stabilized around 93 MB RSS after repeated encodes; constrained WASM libvips was ~217 MB.
Verification:
- Windows x64: complete examples/suite.js passed, including screenshot PNG/WebP, OCR, wait.image/change and scenario image resources.
- Windows x64 autojs.exe: built with normal deno compile, no self-extracting, and runtime-tested for PNG/WebP encode and decode/template matching.
- Cross-compile verified for macOS x64/arm64 and Linux glibc x64/arm64. These targets are compile-verified, not yet native runtime-tested.