PhoenixImage.Optimizer (phx_image v0.1.0)

Copy Markdown View Source

Internal image processing engine used by PhoenixImage.Plug.

Summary

Functions

Fetches and processes an image from source.

Functions

process(source, options \\ [])

Fetches and processes an image from source.

Supported options:

  • :width positive integer
  • :height positive integer
  • :quality integer in 1..100
  • :format :webp | :avif | :jpg | :png

  • :upscale boolean, default false
  • :max_upscale_factor float, default 2.0

Returns:

  • {:ok, binary, mime_type, metadata} on success
  • {:error, reason} on fetch/processing failures