1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00
pigallery2/src/common/SupportedFormats.ts

58 lines
1.6 KiB
TypeScript
Raw Normal View History

2019-12-10 00:19:28 +08:00
export const SupportedFormats = {
2022-04-05 01:37:31 +08:00
Photos: ['gif', 'jpeg', 'jpg', 'jpe', 'png', 'webp', 'svg'],
2019-12-11 17:39:39 +08:00
// Browser supported video formats
// Read more: https://www.w3schools.com/html/html5_video.asp
2022-04-05 01:37:31 +08:00
Videos: ['mp4', 'webm', 'ogv', 'ogg'],
MetaFiles: ['gpx', 'pg2conf', 'md'],
2019-12-11 17:39:39 +08:00
// These formats need to be transcoded (with the build-in ffmpeg support)
TranscodeNeed: {
// based on libvips, all supported formats for sharp: https://github.com/libvips/libvips
Photos: [] as string[],
Videos: [
2022-04-05 01:37:31 +08:00
'avi',
'mkv',
'mov',
'wmv',
'flv',
'mts',
'm2ts',
'mpg',
'3gp',
'm4v',
'mpeg',
'vob',
'divx',
'xvid',
'ts',
],
},
// --------------------------------------------
// Below this, it is autogenerated, DO NOT EDIT
2019-12-10 00:19:28 +08:00
WithDots: {
Photos: [] as string[],
Videos: [] as string[],
MetaFiles: [] as string[],
TranscodeNeed: {
Photos: [] as string[],
Videos: [] as string[],
2022-04-05 01:37:31 +08:00
},
},
2019-12-10 00:19:28 +08:00
};
2022-04-05 01:37:31 +08:00
SupportedFormats.Photos = SupportedFormats.Photos.concat(
SupportedFormats.TranscodeNeed.Photos
);
SupportedFormats.Videos = SupportedFormats.Videos.concat(
SupportedFormats.TranscodeNeed.Videos
);
SupportedFormats.WithDots.Photos = SupportedFormats.Photos.map((f) => '.' + f);
SupportedFormats.WithDots.Videos = SupportedFormats.Videos.map((f) => '.' + f);
SupportedFormats.WithDots.MetaFiles = SupportedFormats.MetaFiles.map(
(f) => '.' + f
);
SupportedFormats.WithDots.TranscodeNeed.Photos =
SupportedFormats.TranscodeNeed.Photos.map((f) => '.' + f);
SupportedFormats.WithDots.TranscodeNeed.Videos =
SupportedFormats.TranscodeNeed.Videos.map((f) => '.' + f);
2019-12-10 00:19:28 +08:00