Skip to main content

auto_thumbnail/
types.rs

1pub const IMAGE_MIME_TYPES: &[&str] = &[
2    "image/jpeg",
3    "image/png",
4    "image/gif",
5    "image/bmp",
6    "image/tiff",
7    "image/webp",
8    "image/x-tga",
9    "image/avif",
10    "image/x-icon",
11    "image/svg+xml",
12    "image/vnd.adobe.photoshop",
13    "image/heic",
14    "image/heif",
15    "image/x-exr",
16    "image/x-portable-anymap",
17    "image/x-portable-graymap",
18    "image/x-portable-pixmap",
19    "image/x-pcx",
20    "image/x-icns",
21    "image/jp2",
22    "image/jpx",
23    "image/vnd.radiance",
24    "image/x-mng",
25    "image/jxl",
26    "image/vnd-ms.dds",
27    "image/x-portable-bitmap",
28];
29
30pub const VIDEO_MIME_TYPES: &[&str] = &[
31    "video/mp4",
32    "video/webm",
33    "video/mpeg",
34    "video/quicktime",
35    "video/theora",
36    "video/x-flv",
37    "video/x-ms-asf",
38    "video/x-msvideo",
39    "video/x-ms-wmv",
40    "video/x-matroska",
41    "application/x-matroska",
42    "application/x-shockwave-flash",
43    "video/3gpp",
44    "video/3gpp2",
45    "video/ogg",
46    "video/x-m4v",
47    "video/x-f4v",
48    "video/vnd.dlna.mpeg-tts",
49    "video/x-ms-vob",
50    "video/mp2t",
51    "video/x-mng",
52];
53
54pub const PDF_MIME_TYPES: &[&str] = &["application/pdf"];
55
56pub const AUDIO_MIME_TYPES: &[&str] = &[
57    "audio/mpeg",
58    "audio/wav",
59    "audio/ogg",
60    "audio/flac",
61    "audio/aac",
62    "audio/mp4",
63    "audio/x-aiff",
64    "audio/amr",
65    "audio/ape",
66];
67
68/// OOXML / ODF 等 ZIP-based Office MIME(OLE 老格式 doc/xls/ppt 由应用层 Shell 兜底)
69pub const OFFICE_MIME_TYPES: &[&str] = &[
70    "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
71    "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
72    "application/vnd.openxmlformats-officedocument.presentationml.presentation",
73];
74
75/// RAW 相机格式扩展名
76pub const RAW_EXTENSIONS: &[&str] = &[
77    "3fr", "arw", "cr2", "cr3", "crw", "dng", "erf", "mrw", "nef", "nrw", "orf", "pef", "raf",
78    "raw", "rw2", "sr2", "srw", "x3f",
79];
80
81/// ZIP-based Office 文档扩展名(OLE 老格式 doc/xls/ppt 由应用层 Shell 兜底)
82pub const OFFICE_EXTENSIONS: &[&str] = &[
83    "docx", "xlsx", "pptx", "potx", "odt", "ods", "odp",
84];
85
86/// 音频扩展名
87pub const AUDIO_EXTENSIONS: &[&str] = &[
88    "aac", "aiff", "amr", "ape", "flac", "m4a", "mp3", "ogg", "wav",
89];