Feature parity with old thumbnails step (store failed attempts in the DB)
This commit is contained in:
2019-05-25 03:50:32 -07:00
parent 242d213a45
commit 02d81ab872
3 changed files with 14 additions and 11 deletions

View File

@@ -4,16 +4,14 @@
**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.2](http://www.profiteroles.org/downloads/Yuba_0.7.12.2.zip)** * **⇩ [Download Yuba 0.7.12.3](http://www.profiteroles.org/downloads/Yuba_0.7.12.3.zip)**
## Features ## Features
* Recursive directory scanning * Scans with RecursiveDirectoryIterator
* Properly interprets bundles * Uses native macOS methods and CLI tools
* Uses native macOS methods
* Spotlight metadata and icons
* Caches assets for re-scans * Caches assets for re-scans
* Optional file hashes * Identifies the most useful information about a file
* Tested with large filesystems * Tested with large filesystems
## Screenshots ## Screenshots

View File

@@ -596,6 +596,8 @@ if ($p['thumbs']) {
$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 - -resize 50% -strip -trim +repage -define png:compression-level=9 ".$tpfile;
// qltool thumbs are double size with half the pixels
// 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;
$cmd['vips'] = $bin_vips." ".$shellpath." -o ".$tfile."[Q=90,optimize_coding] --size=".$p['thumb_size']; $cmd['vips'] = $bin_vips." ".$shellpath." -o ".$tfile."[Q=90,optimize_coding] --size=".$p['thumb_size'];
@@ -627,23 +629,26 @@ if ($p['thumbs']) {
break; break;
} }
$stmt->BindValue(":fid",$fid);
$stmt->BindValue(":created",time());
// store the attempt in the DB so we don't try to generate thumbs for the same fid multiple times
foreach ($priority as $tool) { foreach ($priority as $tool) {
if (@$cmd[$tool]) { if (@$cmd[$tool]) {
$stmt->BindValue(":tool",$tool);
shell_exec($cmd[$tool]." 2>&1"); shell_exec($cmd[$tool]." 2>&1");
msg($cmd[$tool]); msg($cmd[$tool]);
if (is_file($fmt[$tool]) && @filesize($fmt[$tool])) { if (is_file($fmt[$tool]) && @filesize($fmt[$tool])) {
$stmt->BindValue(":fid",$fid);
$stmt->BindValue(":created",time());
$stmt->BindValue(":tool",$tool);
$stmt->BindValue(":relative_path",substr($fmt[$tool], strlen($bpath))); $stmt->BindValue(":relative_path",substr($fmt[$tool], strlen($bpath)));
list($width, $height) = getimagesize($fmt[$tool]); list($width, $height) = getimagesize($fmt[$tool]);
$stmt->BindValue(":width",$width); $stmt->BindValue(":width",$width);
$stmt->BindValue(":height",$height); $stmt->BindValue(":height",$height);
$stmt->execute();
break; break;
} }
} }
} }
$stmt->execute();
} }

View File

@@ -1 +1 @@
0.7.12.2 0.7.12.3