Expand description
Central registry of supported media extensions, MIME types, and asset kinds.
All file-extension lookups in the upload, watch, and library-view paths resolve through this module so the three previously hand-maintained tables cannot drift apart.
Enums§
- Asset
Kind - Discriminant representing whether a media file is an image or a video.
Statics§
- MIME_
BY_ 🔒EXT - Compile-time mapping from lowercased file extensions to standard MIME types.
- RAW_
EXTENSIONS - Camera RAW extensions – subset of SUPPORTED that needs RAW-specific decoding (libraw) instead of pixbuf or image-rs.
- SUPPORTED
- Static set of all supported file extensions for quick membership lookups. Mirrors Immich’s server-accepted formats; MPO is intentionally excluded.
Functions§
- asset_
kind - Determine the media kind based on the prefix of the MIME type.
- extension_
lower 🔒 - Extract the extension from a path and return it lowercased.
- is_
raw_ ext - Whether the extension is a camera RAW format.
- is_
raw_ path - Whether the path’s extension is a camera RAW format.
- is_
supported_ ext - Check if a lowercased extension is present in the supported set.
- is_
supported_ path - Lowercase the path’s extension and return whether it is an accepted media file.
- is_
video_ path - Whether the path’s extension maps to a video MIME type.
- mime_
for - MIME type for a known extension (already lowercased).
- mime_
for_ path - MIME type for any path; falls back to
application/octet-streamfor unknowns.