Reuse your application’s generated thumbnails
ImplementExternalVariantProvider when an existing job, conversion service or
legacy image system already creates your files. The provider returns metadata
for existing objects and checks access to the underlying application record.
Studio calls it while syncing the catalogue and again before delivering a file.
Return immutable, version-specific object paths so an accepted variant keeps
the same bytes for its source version.
The following example assumes your application has a GalleryImage model with
studio_asset_id, workspace_id, owner_key, original_sha256, and a
conversions relation. Each conversion record has name, disk, path,
mime_type, size_bytes, width and height columns.
native.enabled can be an invokable class or a closure
receiving the workspace, entry and principal and returning a boolean. Prefer an
invokable class in cached Laravel configuration. Return true for new Studio
uploads and false for assets whose existing external pipeline owns conversions.
Reuse Spatie conversions
Add the conversion names to your Spatie mount.Reuse FLEX Fields conversions
The optionalUploadManifestVariants provider reads FLEX Fields’ authenticated
upload manifests and their saved receipts. Bind it with the owning application’s
authorization callback and register the binding as an external provider.
queueAuthority to the provider. Its
callback receives the workspace, entry, version, principal, original receipt and
journal ID, and returns the MediaWrite authorized by the owning application’s
Media OS policy. The adapter uses FLEX’s native snapshot checks and exposes
variants after the journal reaches ready. Sync again after completion. Keep
that authority consistent with the file’s record, field and policy.
Use a Spatie mount for FLEX fields backed by Spatie Media Library. The disk-manifest
adapter handles FLEX’s disk upload receipts.
Supply display URLs from a custom frontend transport
The React SDK acceptsthumbnailUrl and previewUrl on each entry. Listing uses
thumbnailUrl only. Set previewUrl to the ready display rendition or null
while it is unavailable. Set previewState to queued or processing while your
worker runs, and return the updated entry from transport.status when ready.
The SDK refreshes visible pending cards and the selected preview. Keep
contentUrl connected to the original for downloads.