Skip to main content

Module thumbnail

Module thumbnail 

Source
Expand description

Thumbnail generation and caching service

Follows a modified freedesktop.org thumbnail spec:

  • Thumbnails stored on the drive itself for portability
  • Named by SHA256 hash of file path
  • Stored as JPEG for smaller size
  • Three sizes: 128, 256, 512

Performance strategy (matches production photo apps):

  1. Extract embedded EXIF thumbnail first (~2ms vs ~200-500ms for full decode)
  2. Fall back to bounded full decode when no adequate embedded preview exists
  3. Per-image timeout to prevent stuck queue from corrupt/huge images
  4. Priority-aware concurrency so visible cells beat background prewarm

Structs§

ThumbnailEntry
Cached thumbnail entry.
ThumbnailService
Thumbnail service with LRU cache management

Enums§

ThumbnailSize
Thumbnail size variants