This commit is contained in:
2019-06-09 23:53:11 -07:00
parent fa79662a12
commit 15d81601c4
8 changed files with 11996 additions and 15 deletions

View File

@@ -4,7 +4,7 @@
**Yuba** generates a web-browsable SQLite database from an HFS+ filesystem. Its client application gathers forensic-quality data about a locally attached disk, properly interpreting bundles, reading Spotlight data, Finder flags, labels, and other contextual information. It can generate hashes, thumbnails, and gather 3rd party metadata with exiftool and mediainfo. Yuba's filesystem catalogues are comprehensive, lightweight, optimized for massive (1 million+) trees, and reflect incremental changes to contents and metadata. A server-side PHP script is provided, which allows familiar, Finder-style browsing of a catalogue. **Yuba** generates a web-browsable SQLite database from an HFS+ filesystem. Its client application gathers forensic-quality data about a locally attached disk, properly interpreting bundles, reading Spotlight data, Finder flags, labels, and other contextual information. It can generate hashes, thumbnails, and gather 3rd party metadata with exiftool and mediainfo. Yuba's filesystem catalogues are comprehensive, lightweight, optimized for massive (1 million+) trees, and reflect incremental changes to contents and metadata. A server-side PHP script is provided, which allows familiar, Finder-style browsing of a catalogue.
* **⇩ [Download Yuba 0.7.12.3](http://www.profiteroles.org/downloads/Yuba_0.7.12.3.zip)** * **⇩ [Download Yuba 0.7.12.5](http://www.profiteroles.org/downloads/Yuba_0.7.12.5.zip)**
## Features ## Features

View File

@@ -84,6 +84,7 @@ $bin_ffmpeg = __DIR__."/bin/ffmpeg";
$bin_qlthumb = __DIR__."/bin/ql-thumbnail"; $bin_qlthumb = __DIR__."/bin/ql-thumbnail";
$bin_qltool = __DIR__."/bin/qltool"; $bin_qltool = __DIR__."/bin/qltool";
$bin_magick = __DIR__."/bin/magick"; $bin_magick = __DIR__."/bin/magick";
$bin_sox = __DIR__."/bin/sox";
$bin_pngcrush = __DIR__."/bin/pngcrush"; $bin_pngcrush = __DIR__."/bin/pngcrush";
$bin_vips = "vipsthumbnail"; $bin_vips = "vipsthumbnail";
@@ -535,6 +536,19 @@ $dbo->exec($stmt);
$wopt_currstep++; $wopt_currstep++;
// Directory Previews
//////////////////////////////////////////
echo ProgressBar::start(count($fx),"Searching for directory previews (".stepString().")");
foreach ($fx as $array) {
$fid = $array[0];
$pathname = $array[1];
if (in_array(basename($pathname),$p['p_files'])) {
$dpreview[dirname($pathname)] = $fid;
}
}
// Thumbnails // Thumbnails
////////////////////////////////////////// //////////////////////////////////////////
@@ -566,7 +580,7 @@ if ($p['thumbs']) {
echo ProgressBar::next("Thumb file found for ".shortlabel($pathname)); echo ProgressBar::next("Thumb file found for ".shortlabel($pathname));
continue; continue;
} elseif ($dbp->query("SELECT EXISTS(SELECT 1 FROM thumbs WHERE fid='".$fid."')")->fetch()[0]) { } elseif ($dbp->query("SELECT EXISTS(SELECT 1 FROM thumbs WHERE fid='".$fid."')")->fetch()[0]) {
// if no thumb file, then poll database // if no thumb file, then poll database for prior attempt
echo ProgressBar::next("Thumb record found for ".shortlabel($pathname)); echo ProgressBar::next("Thumb record found for ".shortlabel($pathname));
continue; continue;
} else { } else {
@@ -586,16 +600,19 @@ if ($p['thumbs']) {
$tmp_path = escapeshellarg("/tmp/".basename($pathname).".png"); // qlmanage workaround $tmp_path = escapeshellarg("/tmp/".basename($pathname).".png"); // qlmanage workaround
$fmt['sips'] = $tfile; $fmt['sips'] = $tfile;
$fmt['sox'] = $tpfile;
$fmt['ffmpeg'] = $tfile; $fmt['ffmpeg'] = $tfile;
$fmt['ql-thumbnail'] = $tfile; $fmt['ql-thumbnail'] = $tfile;
$fmt['qltool'] = $tpfile; $fmt['qltool'] = $tpfile;
$fmt['qlmanage'] = $tpfile; $fmt['qlmanage'] = $tpfile;
$fmt['vips'] = $tfile; $fmt['vips'] = $tfile;
$cmd['sox'] = $bin_sox." ".$shellpath." -n trim 00:10 00:30 spectrogram -o - | ".$bin_magick." convert - -crop 800x515+58+30 -scale 515x515! +dither -colors 16 ".$tpfile;
$cmd['sips'] = "sips -s format jpeg -s formatOptions 80 --resampleHeightWidthMax ".$p['thumb_size']." ".$shellpath." --out ".$tfile; $cmd['sips'] = "sips -s format jpeg -s formatOptions 80 --resampleHeightWidthMax ".$p['thumb_size']." ".$shellpath." --out ".$tfile;
$cmd['ffmpeg'] = $bin_ffmpeg." -ss $(( $(".$bin_mediainfo." --Inform='Video;%Duration%' ".$shellpath." | cut -d'.' -f1) / 10000 )) -i ".$shellpath." -vframes 1 -filter:v scale='400:-1' -q:v 3 ".$tfile; $cmd['ffmpeg'] = $bin_ffmpeg." -ss $(( $(".$bin_mediainfo." --Inform='Video;%Duration%' ".$shellpath." | cut -d'.' -f1) / 10000 )) -i ".$shellpath." -vframes 1 -filter:v scale='400:-1' -q:v 3 ".$tfile;
$cmd['ql-thumbnail'] = $bin_qlthumb." ".$shellpath." ".$tfile." public.jpeg ".$p['thumb_size']." ".$p['thumb_size']." .8"; $cmd['ql-thumbnail'] = $bin_qlthumb." ".$shellpath." ".$tfile." public.jpeg ".$p['thumb_size']." ".$p['thumb_size']." .8";
$cmd['qltool'] = $bin_qltool." di ".$shellpath." ".$p['thumb_size']." ".$p['thumb_size']." | base64 --decode | ".$bin_magick." convert - -resize 50% -strip -trim +repage -define png:compression-level=9 ".$tpfile; //$cmd['qltool'] = $bin_qltool." di ".$shellpath." ".$p['thumb_size']." ".$p['thumb_size']." | base64 --decode | ".$bin_magick." convert - -scale 50% -strip -trim +repage -define png:compression-level=9 ".$tpfile;
$cmd['qltool'] = $bin_qltool." di ".$shellpath." ".$p['thumb_size']." ".$p['thumb_size']." | base64 --decode | ".$bin_magick." convert - -scale 50% -strip -define png:compression-level=9 ".$tpfile;
// qltool thumbs are double size with half the pixels // qltool thumbs are double size with half the pixels
// repage crops thumbs to edge (match sips/ffmpeg thumbs) // repage crops thumbs to edge (match sips/ffmpeg thumbs)
$cmd['qlmanage'] = "qlmanage -ti -f ".floor($p['thumb_size']/128)." -o /tmp/ ".$shellpath."; mv ".$tmp_path." ".$tpfile; $cmd['qlmanage'] = "qlmanage -ti -f ".floor($p['thumb_size']/128)." -o /tmp/ ".$shellpath."; mv ".$tmp_path." ".$tpfile;
@@ -605,6 +622,8 @@ if ($p['thumbs']) {
$external_tool = "sips"; $external_tool = "sips";
} elseif (in_array($ext, $p['t_files']['ffmpeg'])) { } elseif (in_array($ext, $p['t_files']['ffmpeg'])) {
$external_tool = "ffmpeg"; $external_tool = "ffmpeg";
} elseif (in_array($ext, $p['t_files']['sox'])) {
$external_tool = "sox";
} else { } else {
$external_tool = null; $external_tool = null;
} }
@@ -1069,7 +1088,22 @@ foreach ($files as $splFileInfo) {
$stmt->BindValue(":thumb_filename",null); $stmt->BindValue(":thumb_filename",null);
} }
} elseif ($type == "dir") {
if (is_array($dpreview) && $dpreview[$pathname]) {
$fetch_thumb = $dbp->query("SELECT * FROM thumbs WHERE fid='".$dpreview[$pathname]."'")->fetch();
if (@$fetch_thumb['relative_path']) {
$stmt->BindValue(":thumb_filename",$fetch_thumb['relative_path']);
$stmt->BindValue(":thumb_width",$fetch_thumb['width']);
$stmt->BindValue(":thumb_height",$fetch_thumb['height']);
$stmt->BindValue(":thumb_tool",$fetch_thumb['tool']);
} else {
$stmt->BindValue(":thumb_filename",null);
}
}
} }
// ------------------------------------------------ // // ------------------------------------------------ //

11892
bin/parallel Executable file

File diff suppressed because it is too large Load Diff

BIN
bin/sox Executable file

Binary file not shown.

View File

@@ -30,8 +30,19 @@ $p['ignore'] = array( ".DS_Store",
".neofinder.abemeda.volinfo.xml" ".neofinder.abemeda.volinfo.xml"
); );
// p_files will act as a directory preview
$p['p_files'] = array( "folder.jpg",
"cover.jpg",
"preview.jpg",
"cover.png",
"folder.png",
"preview.png");
$p['c_files'] = array( "txt", $p['c_files'] = array( "txt",
"md",
"nfo",
"log", "log",
"cue",
"csv", "csv",
"webloc", "webloc",
"svg", "svg",
@@ -66,8 +77,13 @@ $p['t_files']['sips'] = array( "jpg",
"png", "png",
"heic" ); "heic" );
$p['t_files']['sox'] = array( "flac",
"wav",
"aif",
"aiff" );
// don't make thumbs for these files // don't make thumbs for these files
$p['t_skip'] = array("emlx","flac"); $p['t_skip'] = array("emlx");
$p['m_files'] = array( "mkv", $p['m_files'] = array( "mkv",
"ogg", "ogg",
@@ -171,5 +187,6 @@ 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']['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_files']['sips'] as $ext) { $p['t_files']['sips'][] = strtoupper($ext); }
foreach ($p['t_skip'] as $ext) { $p['t_skip'][] = strtoupper($ext); } foreach ($p['t_skip'] as $ext) { $p['t_skip'][] = strtoupper($ext); }
foreach ($p['p_files'] as $file) { $p['p_files'][] = strtoupper($file); }
?> ?>

View File

@@ -195,7 +195,7 @@ function makeWindowString($p, $strings) {
contents_label_after.width = 40 contents_label_after.width = 40
profile.type = checkbox profile.type = checkbox
profile.label = Generate system profile profile.label = Attach system profile
profile.default = ".$p['profile']." profile.default = ".$p['profile']."
cb.type = cancelbutton cb.type = cancelbutton

View File

@@ -1 +1 @@
0.7.12.4 0.7.12.5

View File

@@ -4,7 +4,7 @@
// Yuba RTC Browser // Yuba RTC Browser
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
$browser_version = "0.7.12"; $browser_version = "0.7.12.5";
require "togggle.php"; require "togggle.php";
require "lib/ref/ref.php"; require "lib/ref/ref.php";
@@ -24,16 +24,42 @@ $overlay_exts = array("txt","php","inc","sh","md","json","cmd");
<meta charset='UTF-8'> <meta charset='UTF-8'>
<style> <style>
html { font-family: Helvetica; word-wrap: break-word; } html { font-family: Helvetica; word-wrap: break-all; word-break: break-all; }
table.file td { width: 33%; } table.file td { width: 33%; }
table.dir td:last-of-type { width: 22%; } table.dir td:last-of-type { width: 22%; }
div#exectime { position: absolute; right: 8px; top: 8px; } div#exectime { position: absolute; right: 8px; top: 8px; }
div.container { display: flex; flex-flow: row wrap; justify-content: center; } div.container { display: flex;
div.item { width: <?=$icon_size+$pad;?>px; height: <?=$icon_size+$pad;?>px; padding-bottom: <?=$pad;?> } flex-flow: row wrap;
div.item { font-size: 11px; } justify-content: center;
}
div.item { width: <?=$icon_size+$pad;?>px;
height: <?=$icon_size+$pad*2;?>px;
text-align: center;
}
div.item { font-size: 11px; }
div.ibox { display: table;
height: calc(100% - <?=$pad;?>px);
width: 100%;
}
div.iibox { display: table-cell;
vertical-align: middle;
}
div.diibox { display: table-cell;
vertical-align: middle;
background: url("/icons/directory.png");
background-repeat: no-repeat;
background-size: <?=$icon_size;?>px;
background-position: center;
}
div.flexfill { width: <?=$icon_size+$pad;?>px; height: 1px; } div.flexfill { width: <?=$icon_size+$pad;?>px; height: 1px; }
div.aborted { text-decoration: line-through; } div.aborted { text-decoration: line-through; }
.slider, .slow_slider { position: absolute !important; top: 50px; right: 10px; width: 200px; } .slider, .slow_slider { position: absolute !important; top: 50px; right: 10px; width: 200px; }
@@ -102,7 +128,7 @@ function wrapImg(xfactor) {
var maxHeight = 0; var maxHeight = 0;
$('div.item').each(function() { $('div.item').each(function() {
$(this).width((<?=$icon_size?>*xfactor)+<?=$pad;?>); $(this).width((<?=$icon_size?>*xfactor)+<?=$pad;?>);
$(this).height((<?=$icon_size?>*xfactor)+<?=$pad;?>); $(this).height((<?=$icon_size?>*xfactor)+<?=$pad*2;?>);
img = $(this).find('img'); img = $(this).find('img');
swidth = $(img).data('width')*xfactor; swidth = $(img).data('width')*xfactor;
sheight = $(img).data('height')*xfactor; sheight = $(img).data('height')*xfactor;
@@ -477,7 +503,7 @@ if ($db_file) {
$height = $row_a['thumb_height']; $height = $row_a['thumb_height'];
$realfile = dirname($db_file).$row_a['thumb_filename']; $realfile = dirname($db_file).$row_a['thumb_filename'];
if (array_key_exists("thumb_tool",$row_a)) { if (array_key_exists("thumb_tool",$row_a)) {
if ($row_a['thumb_tool'] == "sips" || $row_a['thumb_tool'] == "ffmpeg" || $row_a['thumb_tool'] == "ql-thumbnail") { if ($row_a['thumb_tool'] != "qltool" && $row_a['thumb_tool'] != "qlmanage") {
// put a border around images that are not icons // put a border around images that are not icons
$border = "id='thumb'"; $border = "id='thumb'";
} else { } else {
@@ -642,7 +668,6 @@ if ($db_file) {
//} elseif ($item['thumb_filename']) { //} elseif ($item['thumb_filename']) {
if ($item['thumb_filename']) { if ($item['thumb_filename']) {
$aspect = $item['thumb_width']/$item['thumb_height']; $aspect = $item['thumb_width']/$item['thumb_height'];
if ($aspect > 1) { if ($aspect > 1) {
$width = $icon_size; $width = $icon_size;
@@ -651,9 +676,13 @@ if ($db_file) {
$width = $icon_size*$aspect; $width = $icon_size*$aspect;
$height = $icon_size; $height = $icon_size;
} }
if ($item['Type'] == "dir") {
$width = $width/2;
$height = $height/2;
}
$realfile = dirname($db_file).$item['thumb_filename']; $realfile = dirname($db_file).$item['thumb_filename'];
if (array_key_exists("thumb_tool",$item)) { if (array_key_exists("thumb_tool",$item)) {
if ($item['thumb_tool'] == "sips" || $item['thumb_tool'] == "ffmpeg" || $item['thumb_tool'] == "ql-thumbnail") { if ($row_a['thumb_tool'] != "qltool" && $row_a['thumb_tool'] != "qlmanage" && $item['Type'] != "dir") {
// put a border around images that are not icons // put a border around images that are not icons
$border = "id='thumb'"; $border = "id='thumb'";
} else { } else {
@@ -667,11 +696,20 @@ if ($db_file) {
$icon = "<img src='/icons/directory.png' width='".$icon_size."' height='".$icon_size."' data-width='".$icon_size."' data-height='".$icon_size."'>"; $icon = "<img src='/icons/directory.png' width='".$icon_size."' height='".$icon_size."' data-width='".$icon_size."' data-height='".$icon_size."'>";
} else { } else {
$icon = "<img src='".findicon($item['Filename'])."' width='".$icon_size."' height='".$icon_size."' data-width='".$icon_size."' data-height='".$icon_size."'>"; $icon = "<img src='".findicon($item['Filename'])."' width='".$icon_size."' height='".$icon_size."' data-width='".$icon_size."' data-height='".$icon_size."'>";
}
echo "<div class='ibox'>";
if ($item['thumb_filename'] && $item['Type'] == "dir") {
echo "<div class='diibox'>";
} else {
echo "<div class='iibox'>";
} }
echo "\n<a class='".$visibility."' href='?db=".$db_file."&pid=".$item['pid']."'>".$icon."</a>"; echo "\n<a class='".$visibility."' href='?db=".$db_file."&pid=".$item['pid']."'>".$icon."</a>";
echo "</div></div>";
echo "<div class='title'>"; echo "<div class='title'>";
if ($item['UserTags']) { if ($item['UserTags']) {