# PhxMediaLibrary v0.6.1 - Table of Contents

Associate media files with Ecto schemas. Provides image conversions,
responsive images, and multiple storage backends (local, S3).
Inspired by Spatie's Laravel Media Library.

## Pages

- [PhxMediaLibrary](readme.md)
- [Changelog](changelog.md)

- Guides
  - [Getting Started](getting-started.md)
  - [Collections &amp; Conversions](collections-and-conversions.md)
  - [LiveView Integration](liveview.md)
  - [Storage](storage.md)
  - [Error Handling](error-handling.md)
  - [Telemetry](telemetry.md)
  - [Advanced Usage](advanced.md)
  - [Multi-Tenant Media](multi-tenant.md)

## Modules

- [PhxMediaLibrary](PhxMediaLibrary.md): A robust, Ecto-backed media management library for Elixir and Phoenix.
- [PhxMediaLibrary.AsyncProcessor](PhxMediaLibrary.AsyncProcessor.md): Behaviour for async processing adapters.
- [PhxMediaLibrary.AsyncProcessor.Oban](PhxMediaLibrary.AsyncProcessor.Oban.md): Oban-based async processor for reliable background processing.
- [PhxMediaLibrary.AsyncProcessor.Task](PhxMediaLibrary.AsyncProcessor.Task.md): Default async processor using Task.Supervisor.
- [PhxMediaLibrary.Blurhash](PhxMediaLibrary.Blurhash.md): BlurHash generation for images.
- [PhxMediaLibrary.Collection](PhxMediaLibrary.Collection.md): Represents a media collection configuration.
- [PhxMediaLibrary.Components](PhxMediaLibrary.Components.md): Ready-to-use Phoenix LiveView components for media uploads and galleries.
- [PhxMediaLibrary.Config](PhxMediaLibrary.Config.md): Configuration helpers for PhxMediaLibrary.

- [PhxMediaLibrary.Conversion](PhxMediaLibrary.Conversion.md): Represents an image conversion configuration.
- [PhxMediaLibrary.Conversions](PhxMediaLibrary.Conversions.md): Handles the execution of image conversions.

- [PhxMediaLibrary.HasMedia](PhxMediaLibrary.HasMedia.md): Adds media association capabilities to an Ecto schema.
- [PhxMediaLibrary.HasMedia.DSL](PhxMediaLibrary.HasMedia.DSL.md): Provides the `media_collections do ... end` and `media_conversions do ... end`
declarative macros for defining media configuration at compile time.
- [PhxMediaLibrary.ImageProcessor](PhxMediaLibrary.ImageProcessor.md): Behaviour for image processing adapters.
- [PhxMediaLibrary.ImageProcessor.Image](PhxMediaLibrary.ImageProcessor.Image.md): Image processor implementation using the `Image` library.
- [PhxMediaLibrary.ImageProcessor.Null](PhxMediaLibrary.ImageProcessor.Null.md): No-op image processor used when no image processing library is installed.
- [PhxMediaLibrary.LiveUpload](PhxMediaLibrary.LiveUpload.md): Provides upload helpers for Phoenix LiveViews.
- [PhxMediaLibrary.Media](PhxMediaLibrary.Media.md): The Media schema represents a file associated with an Ecto model.
- [PhxMediaLibrary.MediaAdder](PhxMediaLibrary.MediaAdder.md): Builder struct for adding media to a model.
- [PhxMediaLibrary.MediaLive](PhxMediaLibrary.MediaLive.md): A self-contained LiveComponent for media uploads and gallery display.
- [PhxMediaLibrary.MetadataExtractor](PhxMediaLibrary.MetadataExtractor.md): Behaviour and default implementation for extracting file metadata.
- [PhxMediaLibrary.MetadataExtractor.Default](PhxMediaLibrary.MetadataExtractor.Default.md): Default metadata extractor using the `Image` library for images.
- [PhxMediaLibrary.MimeDetector](PhxMediaLibrary.MimeDetector.md): Behaviour and default implementation for content-based MIME type detection.
- [PhxMediaLibrary.MimeDetector.Default](PhxMediaLibrary.MimeDetector.Default.md): Default MIME type detector using magic byte signatures.
- [PhxMediaLibrary.ModelRegistry](PhxMediaLibrary.ModelRegistry.md): Discovers and caches the Ecto schema module for a given `mediable_type` string.
- [PhxMediaLibrary.PathGenerator](PhxMediaLibrary.PathGenerator.md): Behaviour for generating storage paths for media files, plus a set of
delegating functions that route calls to the configured implementation.
- [PhxMediaLibrary.PathGenerator.DateBased](PhxMediaLibrary.PathGenerator.DateBased.md): Date-based path generator for PhxMediaLibrary.
- [PhxMediaLibrary.PathGenerator.Default](PhxMediaLibrary.PathGenerator.Default.md): Default path generator for PhxMediaLibrary.
- [PhxMediaLibrary.PathGenerator.Flat](PhxMediaLibrary.PathGenerator.Flat.md): Flat path generator for PhxMediaLibrary.
- [PhxMediaLibrary.PathGenerator.Tenant](PhxMediaLibrary.PathGenerator.Tenant.md): Tenant-scoped path generator for PhxMediaLibrary.
- [PhxMediaLibrary.Plug.MediaDownload](PhxMediaLibrary.Plug.MediaDownload.md): A Plug that serves local-disk media files with optional `Content-Disposition`
and HMAC-signed URL verification.
- [PhxMediaLibrary.ResponsiveImages](PhxMediaLibrary.ResponsiveImages.md): Generates responsive image variants for optimal loading across devices.
- [PhxMediaLibrary.ResponsiveImages.WidthCalculator](PhxMediaLibrary.ResponsiveImages.WidthCalculator.md): Calculates optimal widths for responsive image generation.
- [PhxMediaLibrary.SignedUrl](PhxMediaLibrary.SignedUrl.md): HMAC-SHA256 signing and verification for time-limited local-disk URLs.
- [PhxMediaLibrary.Storage](PhxMediaLibrary.Storage.md): Behaviour for storage adapters.
- [PhxMediaLibrary.Storage.Disk](PhxMediaLibrary.Storage.Disk.md): Local filesystem storage adapter.
- [PhxMediaLibrary.Storage.Memory](PhxMediaLibrary.Storage.Memory.md): In-memory storage adapter for testing.
- [PhxMediaLibrary.Storage.S3](PhxMediaLibrary.Storage.S3.md): Amazon S3 storage adapter.
- [PhxMediaLibrary.Telemetry](PhxMediaLibrary.Telemetry.md): Telemetry integration for PhxMediaLibrary.
- [PhxMediaLibrary.UrlGenerator](PhxMediaLibrary.UrlGenerator.md): Generates URLs for media files.
- [PhxMediaLibrary.VideoProcessor](PhxMediaLibrary.VideoProcessor.md): Behaviour for video processing adapters.
- [PhxMediaLibrary.VideoProcessor.FFmpeg](PhxMediaLibrary.VideoProcessor.FFmpeg.md): Video processor implementation using `ffprobe` and `ffmpeg`.
- [PhxMediaLibrary.VideoProcessor.Null](PhxMediaLibrary.VideoProcessor.Null.md): No-op video processor used when FFmpeg is not available.
- [PhxMediaLibrary.ViewHelpers](PhxMediaLibrary.ViewHelpers.md): Helper functions for rendering media in Phoenix templates.
- [PhxMediaLibrary.Workers.ProcessConversions](PhxMediaLibrary.Workers.ProcessConversions.md): Oban worker for processing media conversions.

- Exceptions
  - [PhxMediaLibrary.Error](PhxMediaLibrary.Error.md): Base exception for PhxMediaLibrary errors.
  - [PhxMediaLibrary.StorageError](PhxMediaLibrary.StorageError.md): Exception raised when a storage operation fails.
  - [PhxMediaLibrary.ValidationError](PhxMediaLibrary.ValidationError.md): Exception raised when a media validation fails.

## Mix Tasks

- [mix phx_media_library.clean](Mix.Tasks.PhxMediaLibrary.Clean.md): Cleans up orphaned media files.
- [mix phx_media_library.doctor](Mix.Tasks.PhxMediaLibrary.Doctor.md): Runs health checks on the media library and reports issues.
- [mix phx_media_library.gen.migration](Mix.Tasks.PhxMediaLibrary.Gen.Migration.md): Generates a new PhxMediaLibrary migration.
- [mix phx_media_library.install](Mix.Tasks.PhxMediaLibrary.Install.md): Installs PhxMediaLibrary in your project.
- [mix phx_media_library.purge_deleted](Mix.Tasks.PhxMediaLibrary.PurgeDeleted.md): Permanently deletes soft-deleted media items that are older than a given age.
- [mix phx_media_library.regenerate](Mix.Tasks.PhxMediaLibrary.Regenerate.md): Regenerates media conversions.
- [mix phx_media_library.regenerate_responsive](Mix.Tasks.PhxMediaLibrary.RegenerateResponsive.md): Regenerates responsive images for existing media.
- [mix phx_media_library.stats](Mix.Tasks.PhxMediaLibrary.Stats.md): Displays storage statistics for media files.

