Add some video file support
This commit is contained in:
parent
f6f3f8d80e
commit
6f83d1075f
|
@ -321,6 +321,24 @@ function getDefaultConfig() {
|
|||
longDescUtil : 'Exiftool',
|
||||
},
|
||||
//
|
||||
// Video
|
||||
//
|
||||
'video/mp4' : {
|
||||
desc : 'MPEG Video',
|
||||
shortDescUtil : 'Exiftool2Desc',
|
||||
longDescUtil : 'Exiftool',
|
||||
},
|
||||
'video/x-matroska ' : {
|
||||
desc : 'Matroska Video',
|
||||
shortDescUtil : 'Exiftool2Desc',
|
||||
longDescUtil : 'Exiftool',
|
||||
},
|
||||
'video/x-msvideo' : {
|
||||
desc : 'Audio Video Interleave',
|
||||
shortDescUtil : 'Exiftool2Desc',
|
||||
longDescUtil : 'Exiftool',
|
||||
},
|
||||
//
|
||||
// Images
|
||||
//
|
||||
'image/jpeg' : {
|
||||
|
|
|
@ -17,6 +17,7 @@ const FILETYPE_HANDLERS = {};
|
|||
[ 'AIFF', 'APE', 'FLAC', 'OGG', 'MP3' ].forEach(ext => FILETYPE_HANDLERS[ext] = audioFile);
|
||||
[ 'PDF', 'DOC', 'DOCX', 'DOCM', 'ODB', 'ODC', 'ODF', 'ODG', 'ODI', 'ODP', 'ODS', 'ODT' ].forEach(ext => FILETYPE_HANDLERS[ext] = documentFile);
|
||||
[ 'PNG', 'JPEG', 'GIF', 'WEBP', 'XCF' ].forEach(ext => FILETYPE_HANDLERS[ext] = imageFile);
|
||||
[ 'MP4', 'MOV', 'AVI', 'MKV', 'MPG', 'MPEG', 'M4V', 'WMV' ].forEach(ext => FILETYPE_HANDLERS[ext] = videoFile);
|
||||
|
||||
function audioFile(metadata) {
|
||||
// nothing if we don't know at least the author or title
|
||||
|
@ -32,6 +33,10 @@ function audioFile(metadata) {
|
|||
return desc;
|
||||
}
|
||||
|
||||
function videoFile(metadata) {
|
||||
return `${metadata.fileType} video(${metadata.imageSize}px, ${metadata.duration}, ${metadata.audioBitsPerSample}/${metadata.audioSampleRate} audio)`;
|
||||
}
|
||||
|
||||
function documentFile(metadata) {
|
||||
// nothing if we don't know at least the author or title
|
||||
if(!metadata.author && !metadata.title) {
|
||||
|
|
Loading…
Reference in New Issue