Files
Yuba/filetypes.php
2019-06-16 04:54:42 -07:00

251 lines
4.9 KiB
PHP
Executable File

<?php
// Filetypes
//////////////////////////////////////////
// Bundled tools
$bin_gfi = __DIR__."/bin/GetFileInfo";
$bin_mediainfo = __DIR__."/bin/mediainfo";
$bin_exiftool = __DIR__."/bin/exiftool";
$bin_ffmpeg = __DIR__."/bin/ffmpeg";
$bin_qlthumb = __DIR__."/bin/ql-thumbnail";
$bin_qltool = __DIR__."/bin/qltool";
$bin_sox = __DIR__."/bin/sox";
$bin_pngcrush = __DIR__."/bin/pngcrush";
$bin_parallel = __DIR__."/bin/parallel";
// System tools
$bin_php = "php";
$bin_qlmanage = "qlmanage";
$bin_sips = "qlmanage";
// External tools
$bin_convert = "/opt/local/bin/convert";
$bin_vips = "/opt/local/bin/vipsthumbnail";
// Treat these directories as files
$p['bundles'] = array( "app",
"bundle",
"sparsebundle",
"photoslibrary",
"aplibrary",
"apvault",
"abbu",
"calendar",
"framework",
"plugin",
"kext",
"rtfd"
);
// Completely ignore these files
$p['ignore'] = array( ".Trashes",
".DocumentRevisions-V100",
".Spotlight-V100",
".TemporaryItems",
".apdisk",
".com.apple.timemachine.donotpresent",
".fseventsd",
".metadata-never-index",
".neofinder.abemeda.volinfo.xml"
);
// Use these files as a directory preview
$p['p_files'] = array( "folder.jpg",
"cover.jpg",
"preview.jpg",
"cover.png",
"folder.png",
"preview.png");
// Gather contents for these files
$p['c_files'] = array( "DS_Store",
"txt",
"md",
"nfo",
"log",
"cue",
"csv",
"webloc",
"svg",
"rtf",
"rtfd",
"doc",
"docx" );
// thumbnail bindings
$p['t_f']['pdf'][] = "jpg";
$p['t_f']['pdf'][] = array("qlmanage","sips","vips");
// Use ffmpeg to generate thumbnails for these files
$p['t_files']['ffmpeg'] = array( "mkv",
"avi",
"mpeg",
"mpg",
"vob",
"mp4",
"m4v",
"m2v",
"m2ts",
"asf",
"wmv",
"rm",
"divx",
"fla",
"flv",
"webm" );
// Use sips to generate thumbnails for these files
$p['t_files']['sips'] = array( "jpg",
"jpeg",
"tif",
"tiff",
"gif",
"psd",
"png",
"heic",
"pdf",
"ai",
"ps",
"bmp",
"pict",
"jp2" );
// Use sox to generate thumbnails for these files
$p['t_files']['sox'] = array( "flac",
"wav",
"aif",
"aiff" );
// Don't make thumbnails for these files
$p['t_skip'] = array( "emlx",
"DS_Store" );
// Don't make icons for these files
$p['i_skip'] = array( "jpg",
"jpeg",
"tif",
"tiff",
"gif",
"png",
"heic",
"flac",
"wav",
"aiff",
"aif",
"zip",
"DS_Store" );
// Custom qlgenerator bindings
$p['i_bindings']['indd'] = array("com.adobe.indesign-document","Art View.qlgenerator");
// Run mediainfo on these files
$p['m_files'] = array( "mkv",
"ogg",
"avi",
"wav",
"mpeg",
"mpg",
"vob",
"mp4",
"m2v",
"mp3",
"asf",
"wma",
"wmv",
"qt",
"mov",
"rm",
"ifo",
"ac3",
"dts",
"aac",
"ape",
"flac",
"aiff",
"m2ts" );
// Run exiftool on these files
$p['e_files'] = array( "ai",
"aiff",
"ape",
"asf",
"avi",
"bmp",
"divx",
"dng",
"doc",
"docx",
"eps",
"epub",
"exe",
"exif",
"fla",
"flac",
"flv",
"gif",
"heic",
"icc",
"iso",
"jpg",
"jpeg",
"m2ts",
"m4a",
"m4b",
"m4v",
"mkv",
"mobi",
"azw",
"azw3",
"mov",
"qt",
"mp3",
"mp4",
"mpeg",
"mpg",
"m2v",
"nef",
"numbers",
"ogg",
"pages",
"pdf",
"pict",
"png",
"ppm",
"ppt",
"psd",
"psb",
"qif",
"raw",
"rtf",
"sr2",
"srf",
"svg",
"swf",
"tiff",
"tif",
"torrent",
"vcf",
"vob",
"wav",
"webm",
"wma",
"wmv",
"xls",
"xlsx",
"xmp",
"zip",
"ps" );
// Ucase
foreach ($p['bundles'] as $bundle) { $p['nodescend'][] = "*.".$bundle; }
foreach ($p['c_files'] as $ext) { $p['c_files'][] = strtoupper($ext); }
foreach ($p['e_files'] as $ext) { $p['e_files'][] = strtoupper($ext); }
foreach ($p['m_files'] as $ext) { $p['m_files'][] = strtoupper($ext); }
foreach ($p['t_files']['ffmpeg'] as $ext) { $p['t_files']['ffmpeg'][] = strtoupper($ext); }
foreach ($p['t_files']['sips'] as $ext) { $p['t_files']['sips'][] = strtoupper($ext); }
foreach ($p['t_skip'] as $ext) { $p['t_skip'][] = strtoupper($ext); }
foreach ($p['i_skip'] as $ext) { $p['i_skip'][] = strtoupper($ext); }
foreach ($p['p_files'] as $file) { $p['p_files'][] = strtoupper($file); }
?>