Examples use FlexImageUpload from Bjanczak\FilamentFlexFields\Filament\Forms\Components.
Named image conversions
The preview uses thumb in avatar, list and grid layouts. The viewer defaults to the original; choose its own conversion with fileViewerConversion(). The image editor, Open and Download retain the original. The selected conversion must exist. While queued conversion work is unfinished, the original remains the fallback.
The Spatie wrapper supports the same previewConversion('thumb') option, or its inherited conversion('thumb') option. Explicit previewConversion() takes precedence. Define Spatie conversions on your media model; native imageConversions() belong to the disk uploader.
Thumbnails for newly selected files
Browser-local thumbnail generation is off by default. Enable it explicitly with previewThumbnailSize(512) (or another supported size) for newly selected static JPEG, PNG and WebP images. Generation runs after admission, independently of the upload. Until it completes, the original local preview remains visible. The thumbnail encoder does not change upload or image-editor bytes. Any explicitly configured upload resize/crop or server conversion still applies through its own lifecycle.
The default previewThumbnailSize(null) disables local resizing. Accepted sizes are 64–2048 px, including a closure returning a size or null. Images already smaller than the configured size remain unchanged. Animated GIF/APNG/WebP, AVIF, unsupported decoders, conversion failures and images exceeding the field’s pixel budget keep their original local preview. Local thumbnails are temporary display resources, not persisted conversions. Removing/replacing the file or destroying the field releases their resources.
See all conversion options for crop, focus, padding, format, quality, orientation and animation handling.
Background image processing
Off by default. Permanent source validation/storage completes first. After the record references the source and commits, the worker creates derivatives. The model value stays the original path.
Before completion, existing files remain visible with their original preview. Lists display a processing caption; grid tiles retain their transfer/delete presentation with an accessible processing status. When ready, the selected preview changes without replacing the file or refreshing the whole page. Failed conversion jobs retain the original.
Use shared storage and queue configuration. To restore synchronous conversions:
For Spatie, use model ->queued() conversions and field ->conversion('thumb'). Do not enable the second native conversion engine. Spatie setup.
Image resource budget
Optimization shortcuts
For AVIF-capable GD:
Shortcuts create an optimized derivative. Do not also declare an explicit conversion named optimized. Named conversions give you more control for new configurations. Re-encoding strips source metadata; stripExif(false) is rejected when compatibility optimization is active, because this encoder produces metadata-free derivatives. Originals remain stored.
Image editor
Circular avatar editor:
Editor transformations affect the file selected for transfer. The optional information editor changes alt/title/caption metadata separately.
Static default avatar
The placeholder is display-only: it consumes no file slot and is never saved as an uploaded file.
Any avatar provider
AvatarUrlProvider is your own service: DiceBear, a local generator or another provider can supply the URL. Cache expensive generation in that service. Use relative or HTTP(S) image URLs. On delivery failure the field returns to its centered icon; provider exceptions use the configured fallback.
Conditional/default-free avatar:
URL import
Import uses the field’s size, type, extension, dimension and custom per-file rules. Remote fetch protections additionally reject unsafe destinations. It does not bypass final scanning, access policies or permanent-save validation. Failed staged imports are removed.
Camera capture
The browser needs a secure context and camera permission. Camera capture is available only for image-compatible fields. Avatar mode prefers the user-facing camera; other image fields prefer the environment camera.
All sources together
Source-tab variants: default and ghost. Alternate sources retain their source identity in optional transport events and use the same information editor and Media OS persistence as local selection.
Separate thumbnail and lightbox conversion
A missing/pending conversion uses the original. For Spatie, register thumb and large on the media model and use the same two field selectors; do not declare native imageConversions() on that wrapper. Use legacy preview URL resolvers when variants were generated outside either engine. Last modified on October 16, 2026