PhoenixImageTools (phoenix_image_tools v0.3.0)

View Source

PhoenixImageTools is a comprehensive solution for handling responsive images in Phoenix applications.

This library provides tools for:

  • Uploading and processing images
  • Creating multiple image sizes for responsive web applications
  • Converting images to optimized formats (WebP)
  • Providing Phoenix LiveView components for responsive image display
  • Supporting S3-compatible storage

Summary

Functions

Returns the configured write options for image processing.

Returns the configured bucket name for S3 storage.

Returns the width for a given size name.

Returns the configured image sizes.

Returns the configured cache control max-age value in seconds.

Returns the configured output extension for processed images.

Returns the configured streaming options for image processing.

Returns the configured thumbnail options for image processing.

Returns the configured write options for image processing.

Functions

asset_host()

Returns the configured write options for image processing.

bucket_name()

Returns the configured bucket name for S3 storage.

get_width_from_size(size)

Returns the width for a given size name.

Examples

iex> PhoenixImageTools.get_width_from_size(:md)
1024

image_sizes()

Returns the configured image sizes.

Examples

iex> PhoenixImageTools.image_sizes()
[xs: 320, sm: 768, md: 1024, lg: 1280, xl: 1536]

max_age()

Returns the configured cache control max-age value in seconds.

Examples

iex> PhoenixImageTools.max_age()
31536000

output_extension()

Returns the configured output extension for processed images.

Examples

iex> PhoenixImageTools.output_extension()
"webp"

stream_image_options()

Returns the configured streaming options for image processing.

thumbnail_options()

Returns the configured thumbnail options for image processing.

write_image_options()

Returns the configured write options for image processing.