Mixed file galleries
Cotton can represent photos, documents, audio, video, and model files in the same browser file surface. That matters for real libraries where media, work documents, scans, notes, recordings, and design files live together.
- Image, SVG, and HEIC preview paths cover common photo libraries.
- PDF and text previews make documents readable without downloading first.
- Audio can show cover art or generated waveform thumbnails plus an in-app player.
Preview surfaces that exist
The preview story is backed by concrete file surfaces: image/SVG/HEIC rendering, PDF and text previews, audio waveform or cover-art thumbnails, synchronized lyrics, native video playback, on-demand HLS for legacy video, model thumbnails, share-page context, and cache-friendly delivery over Cotton-managed content.
What this means
Previews decide whether a self-hosted cloud feels like a product or a cold object bucket. Cotton treats the preview layer as part of the file workflow: browse, inspect, share, seek, and only download when that is actually the next step.
PDF that stays in the app
PDF previews are not just download buttons in disguise. On mobile, this matters most: Cotton can keep the document in the browser workflow, and selectable text can stay usable when the PDF source contains real text.
Audio waveform and lyrics
Audio previews first try embedded cover art, then fall back to generated waveform artwork. The player can also use sidecar text tracks such as LRC/SRT for synced lyrics without pretending the audio file is just a dead blob.
Video frame extraction
Video previews are generated through a controlled FFmpeg path that can read through range-capable streams. The goal is to show useful posters without turning every video into a giant temporary download.
On-demand HLS for old video
Browser-native video can stream as the original file with Range support. Legacy video such as AVI/MKV can be opened through token-authorized HLS: Cotton builds playlists, transcodes short segments on demand from the chunked source stream, and caches segments briefly instead of preconverting the whole file.
Managed preview paths
Most everyday preview work stays close to the managed .NET runtime: image, SVG, HEIC, text, and PDF generation do not require turning the app into a pile of unrelated services. FFmpeg is kept for audio/video, and f3d is kept for model thumbnails.
Priority and load awareness
Preview generation is part of normal product work, not an after-hours maintenance script. Cotton can prioritize preview jobs and use active-upload plus quiet-hour signals so heavier background work does not sabotage foreground transfers or make a home server noisy at the wrong time.
Share page context
Previews also matter outside the account. A recipient opening a shared file should understand what they received before downloading it, especially for media, PDF, and model files.
Cache-friendly delivery
Previews are stored by content identity, support cache-friendly responses, and expose encrypted preview hashes instead of raw storage keys.
Where previews must stay careful
Preview support is only credible when it respects the file type and security boundary. Some formats need safe generator support, and client-side encrypted folders must not be marketed as if server-side preview extraction can see plaintext everywhere.