Registry and dispatch for image previewers.
An image previewer accepts a content type and a system tool, checks at runtime whether the tool is available, and renders a preview image.
Each module wraps exactly one CLI tool. Multiple modules can target the same content type — the dispatcher picks the first one whose binary is installed, so installing any of them is enough.
Ships with:
Attached.Processors.ImagePreviewers.Video.FFmpeg— extracts first frame viaffmpegAttached.Processors.ImagePreviewers.Pdf.Pdftoppm— renders first page viapdftoppm(poppler)Attached.Processors.ImagePreviewers.Pdf.Mutool— renders first page viamutool(MuPDF)Attached.Processors.ImagePreviewers.Epub.EpubThumbnailer— extracts cover viaepub-thumbnailer(Nix)Attached.Processors.ImagePreviewers.Epub.GnomeEpubThumbnailer— extracts cover viagnome-epub-thumbnailer(apt)
Configuration
Image previewers are tried in order. Override the list to add your own or reorder fallbacks:
config :attached, image_previewers: [
Attached.Processors.ImagePreviewers.Video.FFmpeg,
Attached.Processors.ImagePreviewers.Pdf.Mutool,
Attached.Processors.ImagePreviewers.Pdf.Pdftoppm,
MyApp.ImagePreviewers.Office
]
Summary
Functions
Returns the first image previewer that accepts the given content type and
whose runtime dependencies are available. nil if none match.
Returns all configured image previewers (regardless of availability).