Files
Yuba/filetypes.php

325 lines
7.9 KiB
PHP
Raw Permalink Normal View History

2018-08-08 23:12:47 -07:00
<?php
2018-09-01 21:30:02 -07:00
// Filetypes
2018-08-08 23:12:47 -07:00
//////////////////////////////////////////
2019-06-12 22:15:32 -07:00
// Bundled tools
2019-10-08 02:36:10 -07:00
$bin_gfi = escapeshellarg(__DIR__."/bin/GetFileInfo");
$bin_mediainfo = escapeshellarg(__DIR__."/bin/mediainfo");
$bin_exiftool = escapeshellarg(__DIR__."/bin/exiftool");
$bin_ffmpeg = escapeshellarg(__DIR__."/bin/ffmpeg");
$bin_qlthumb = escapeshellarg(__DIR__."/bin/ql-thumbnail");
2019-10-15 18:32:21 -07:00
$bin_qlicon = escapeshellarg(__DIR__."/bin/ql-icon");
2019-10-21 18:56:29 -07:00
$bin_iff = escapeshellarg(__DIR__."/bin/iff");
2019-10-08 02:36:10 -07:00
$bin_qltool = escapeshellarg(__DIR__."/bin/qltool");
$bin_sox = escapeshellarg(__DIR__."/bin/sox");
2019-10-15 18:32:21 -07:00
$bin_pngquant = escapeshellarg(__DIR__."/bin/pngquant");
2019-10-08 02:36:10 -07:00
$bin_parallel = escapeshellarg(__DIR__."/bin/parallel");
$bin_convert = escapeshellarg(__DIR__."/bin/convert");
2019-10-15 18:32:21 -07:00
$bin_flacicon = escapeshellarg(__DIR__."/bin/flacicon");
2019-10-16 03:41:42 -07:00
$bin_flacdiricon = escapeshellarg(__DIR__."/bin/flacdiricon");
2019-06-16 04:54:42 -07:00
// System tools
2019-10-19 05:54:29 -07:00
$bin_php = "/usr/bin/php";
$bin_qlmanage = "/usr/bin/qlmanage";
$bin_sips = "/usr/bin/sips";
2019-06-12 22:15:32 -07:00
// External tools
2019-06-16 04:54:42 -07:00
$bin_vips = "/opt/local/bin/vipsthumbnail";
2019-06-10 22:04:25 -07:00
2019-06-13 06:24:02 -07:00
// Treat these directories as files
2019-05-22 00:59:01 -07:00
$p['bundles'] = array( "app",
"bundle",
"sparsebundle",
"photoslibrary",
"aplibrary",
"apvault",
"abbu",
"calendar",
"framework",
"plugin",
"kext",
2019-10-21 18:56:29 -07:00
"rtfd",
"qlgenerator",
"workflow"
2019-05-22 00:59:01 -07:00
);
2019-04-27 00:48:25 -07:00
2019-06-13 06:24:02 -07:00
// Completely ignore these files
2019-06-12 22:15:32 -07:00
$p['ignore'] = array( ".Trashes",
2019-05-22 00:59:01 -07:00
".DocumentRevisions-V100",
".Spotlight-V100",
".TemporaryItems",
".apdisk",
".com.apple.timemachine.donotpresent",
".fseventsd",
".metadata-never-index",
".neofinder.abemeda.volinfo.xml"
);
2019-06-13 06:24:02 -07:00
// Use these files as a directory preview
2019-06-09 23:53:11 -07:00
$p['p_files'] = array( "folder.jpg",
"cover.jpg",
"preview.jpg",
"cover.png",
"folder.png",
"preview.png");
2019-06-13 06:24:02 -07:00
// Gather contents for these files
2019-06-12 22:15:32 -07:00
$p['c_files'] = array( "DS_Store",
"txt",
2019-06-09 23:53:11 -07:00
"md",
"nfo",
2019-05-22 00:59:01 -07:00
"log",
2019-06-09 23:53:11 -07:00
"cue",
2019-05-22 00:59:01 -07:00
"csv",
"webloc",
"svg",
"rtf",
"rtfd",
"doc",
"docx" );
2019-10-19 05:54:29 -07:00
// Thumbnail bindings
$p['t_b']['mkv'] = array("ql-thumbnail","ffmpeg");
$p['t_b']['avi'] = array("ql-thumbnail","ffmpeg");
$p['t_b']['mpeg'] = array("ql-thumbnail","ffmpeg");
$p['t_b']['mpg'] = array("ql-thumbnail","ffmpeg");
$p['t_b']['vob'] = array("ql-thumbnail","ffmpeg");
$p['t_b']['mp4'] = array("ql-thumbnail","ffmpeg");
$p['t_b']['m4v'] = array("ql-thumbnail","ffmpeg");
$p['t_b']['m2v'] = array("ql-thumbnail","ffmpeg");
$p['t_b']['m2ts'] = array("ql-thumbnail","ffmpeg");
$p['t_b']['asf'] = array("ql-thumbnail","ffmpeg");
$p['t_b']['wmv'] = array("ql-thumbnail","ffmpeg");
$p['t_b']['rm'] = array("ql-thumbnail","ffmpeg");
$p['t_b']['divx'] = array("ql-thumbnail","ffmpeg");
$p['t_b']['fla'] = array("ql-thumbnail","ffmpeg");
$p['t_b']['flv'] = array("ql-thumbnail","ffmpeg");
$p['t_b']['webm'] = array("ql-thumbnail","ffmpeg");
2019-10-21 18:56:29 -07:00
// sips provides a minor speed improvement but also scales small images up
//$p['t_b']['jpg'] = array("sips","ql-thumbnail","vips");
//$p['t_b']['jpeg'] = array("sips","ql-thumbnail","vips");
//$p['t_b']['png'] = array("sips","ql-thumbnail","vips");
$p['t_b']['jpg'] = array("ql-thumbnail","sips","vips");
$p['t_b']['jpeg'] = array("ql-thumbnail","sips","vips");
$p['t_b']['png'] = array("ql-thumbnail","sips","vips");
2019-05-22 04:02:22 -07:00
2019-10-19 05:54:29 -07:00
$p['t_b']['tif'] = array("vips","sips","ql-thumbnail");
$p['t_b']['tiff'] = array("vips","sips","ql-thumbnail");
2019-06-09 23:53:11 -07:00
2019-10-19 05:54:29 -07:00
$p['t_b']['nik'] = array("ql-thumbnail","sips","vips");
$p['t_b']['dng'] = array("ql-thumbnail","sips","vips");
$p['t_b']['gif'] = array("ql-thumbnail","sips","vips");
$p['t_b']['psd'] = array("ql-thumbnail","sips","vips");
$p['t_b']['heic'] = array("ql-thumbnail","sips","vips");
$p['t_b']['pdf'] = array("ql-thumbnail","sips","vips");
$p['t_b']['ai'] = array("ql-thumbnail","sips","vips");
$p['t_b']['ps'] = array("ql-thumbnail","sips","vips");
$p['t_b']['bmp'] = array("ql-thumbnail","sips","vips");
$p['t_b']['pict'] = array("ql-thumbnail","sips","vips");
$p['t_b']['jp2'] = array("ql-thumbnail","sips","vips");
$p['t_b']['flac'] = array("sox");
$p['t_b']['wav'] = array("sox");
$p['t_b']['aif'] = array("sox");
$p['t_b']['aiff'] = array("sox");
$p['t_b']['au'] = array("sox");
$p['t_b']['wv'] = array("sox");
$p['t_b']['snd'] = array("sox");
$p['t_b']['voc'] = array("sox");
$p['t_b']['m4a'] = array("sox","ql-thumbnail");
$p['t_b']['m4b'] = array("sox","ql-thumbnail");
$p['t_b']['ogg'] = array("sox","ql-thumbnail");
2020-01-27 03:32:56 -08:00
$p['t_b']['mp3'] = array();
$p['t_b']['DS_Store'] = array();
2019-10-19 07:49:11 -07:00
foreach ($p['bundles'] as $bundle) { $p['t_b'][$bundle] = array("qltool"); }
2019-10-19 05:54:29 -07:00
$p['t_b']['*'] = "ql-thumbnail";
2019-06-13 06:24:02 -07:00
// Don't make icons for these files
$p['i_skip'] = array( "jpg",
"jpeg",
"tif",
"tiff",
"gif",
"png",
"heic",
"flac",
"wav",
"aiff",
"aif",
2019-06-14 02:14:09 -07:00
"zip",
"DS_Store" );
2019-10-19 05:54:29 -07:00
// Make sox preview icons for these files
$p['i_sox'] = array( "flac",
"wav",
"aif",
"aiff",
"au",
"wv",
"snd",
"voc" );
2019-06-13 06:24:02 -07:00
// Run mediainfo on these files
2019-05-22 00:59:01 -07:00
$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" );
2018-08-08 23:12:47 -07:00
2019-06-13 06:24:02 -07:00
// Run exiftool on these files
2019-05-22 00:59:01 -07:00
$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",
2019-06-14 02:14:09 -07:00
"zip",
"ps" );
2018-08-08 23:12:47 -07:00
2019-06-13 06:24:02 -07:00
// Ucase
2019-05-22 00:59:01 -07:00
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); }
2019-06-13 23:17:00 -07:00
foreach ($p['i_skip'] as $ext) { $p['i_skip'][] = strtoupper($ext); }
2019-10-19 05:54:29 -07:00
foreach ($p['i_sox'] as $ext) { $p['i_sox'][] = strtoupper($ext); }
2019-06-09 23:53:11 -07:00
foreach ($p['p_files'] as $file) { $p['p_files'][] = strtoupper($file); }
2018-08-08 23:12:47 -07:00
2019-10-16 03:41:42 -07:00
// Spotlight //////////////////////////////////////////
$mb['i'] = array( "PixelWidth",
"PixelHeight",
"Latitude",
"Longitude",
"DurationSeconds",
"UseCount",
"FSInvisible",
"NumberOfPages",
"PageHeight",
"PageWidth",
"TotalBitRate" );
$mb['t'] = array( "Title",
"ContentType",
"Creator",
"FSCreatorCode",
"Kind",
"FSTypeCode" );
$mb['a'] = array( "UserTags",
"WhereFroms",
"EncodingApplications" );
$mb['d'] = array( "DateAdded",
"LastUsedDate",
"ContentModificationDate",
"ContentCreationDate" );
$ibuild[] = ":pid, :spotlight";
$cbuild[] = "pid TEXT, spotlight TEXT";
foreach (array_merge($mb['i'],$mb['d']) as $item) {
$cbuild[] = $item." INTEGER";
$ibuild[] = ":".$item;
}
foreach (array_merge($mb['t'],$mb['a']) as $item) {
$cbuild[] = $item." TEXT";
$ibuild[] = ":".$item;
}
2019-10-19 07:49:11 -07:00
unset($item, $bundle, $ext, $file);
2019-10-16 03:41:42 -07:00
2019-10-19 05:54:29 -07:00
// Album dirs //////////////////////////////////////////
$p['album_files'] = array("flac","mp3","mp4","wav","ogg","aiff","aif");
$p['cover_files'] = array("cover","folder","front","dir");
$p['cover_exts'] = array("jpg","jpeg","png");
2018-08-08 23:12:47 -07:00
?>