Probes the local libvips build for optional encoder capabilities.
Run once at application boot. Results are cached in
:persistent_term so per-request reads are free.
Currently probes AVIF, JP2, and TIFF write support. Adding a
probe for another capability is one new clause in probe/0 and
one new accessor.
Summary
Functions
Returns whether the local libvips can encode AVIF.
Returns whether the local libvips can encode JPEG 2000 (JP2).
Performs every capability probe and caches the results.
Returns whether the local libvips can encode TIFF.
Functions
@spec avif_write?() :: boolean()
Returns whether the local libvips can encode AVIF.
Falls back to a one-off probe if probe/0 (in this module) has
not been called — useful in tests that exercise the encoder
without booting the application.
Returns
trueif libvips can write AVIF.falseotherwise.
Examples
iex> is_boolean(Image.Plug.Capabilities.avif_write?())
true
@spec jp2_write?() :: boolean()
Returns whether the local libvips can encode JPEG 2000 (JP2).
Required by IIIF Image API 3.0 Compliance Level 2 deployments
that promise JP2 support. Available only when libvips was built
with libopenjp2.
Returns
trueif libvips can write JP2.falseotherwise.
@spec probe() :: :ok
Performs every capability probe and caches the results.
Idempotent: calling probe/0 twice in the same VM lifetime returns
the same booleans without re-probing.
Returns
:ok.
@spec tiff_write?() :: boolean()
Returns whether the local libvips can encode TIFF.
Required by IIIF Image API 3.0 Compliance Level 2 deployments that promise TIFF support.
Returns
trueif libvips can write TIFF.falseotherwise.