Behaviour for image processing adapters.
The default implementation uses the Image library (libvips).
Summary
Callbacks
Apply a conversion to an image.
Get image dimensions.
Open an image from a file path.
Save an image to a file path. Returns the image for chaining.
Generate a tiny placeholder (base64 encoded).
Types
@type image() :: any()
Callbacks
@callback apply_conversion(image(), PhxMediaLibrary.Conversion.t()) :: {:ok, image()} | {:error, term()}
Apply a conversion to an image.
@callback dimensions(image()) :: {:ok, {width :: integer(), height :: integer()}} | {:error, term()}
Get image dimensions.
Open an image from a file path.
Save an image to a file path. Returns the image for chaining.
Generate a tiny placeholder (base64 encoded).