ThumbTester tweaks

This commit is contained in:
2019-08-26 00:42:00 -07:00
parent 6d2a5cf760
commit 1ed3f0b85c
10 changed files with 15 additions and 1433 deletions

View File

@@ -2,6 +2,8 @@
// Yuba Preview Tester 0.1.2
//print_r($argv); die;
$mode = $argv[1];
if (empty($argv[2])) { echo "Nothing dragged"; die; }
@@ -57,11 +59,11 @@ if ($mode == "thumb") {
$cmd['ql-thumbnail'][] = $bin_qlthumb." ".$shellpath." ".$tprefix."qlthumb.jpg public.jpeg ".$p['thumb_size']." ".$p['thumb_size']." .8";
$cmd['ql-thumbnail'][] = $tprefix."qlthumb.jpg";
$cmd['sox'][] = $bin_sox." ".$shellpath." -n trim 0 $(".$bin_exiftool." -s -s -s -duration# ".$shellpath." | awk '{print $1/10}') spectrogram -o - | ".$bin_convert." - -crop 800x515+58+30 -scale 515x515! +dither -colors 16 ".$tprefix."sox.png";
$cmd['sox'][] = $bin_sox." ".$shellpath." -n trim 0 $(".$bin_exiftool." -s -s -s -duration# ".$shellpath." | awk '{print $1/10}') spectrogram -o - | ".$bin_convert." - -crop 800x515+58+30 +dither -colors 16 ".$tprefix."sox.png";
//$cmd['sox'][] = $bin_sox." ".$shellpath." -n trim 0 $(".$bin_exiftool." -s -s -s -duration# ".$shellpath." | awk '{print $1/10}') spectrogram -o ".$tpfile."; ".$bin_sips." -s format jpeg -s formatOptions 80 ".escapeshellarg($tpfile)." --out ".$tprefix."sox.png";
$cmd['sox'][] = $tprefix."sox.png";
$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 ".$tprefix."ffmpeg.jpg";
$cmd['ffmpeg'][] = $bin_ffmpeg." -ss $(( $(".$bin_mediainfo." --Inform='Video;%Duration%' ".$shellpath." | cut -d'.' -f1) / 10000 )) -i ".$shellpath." -vframes 1 -filter:v scale='".$p['thumb_size'].":-2' -q:v 3 ".$tprefix."ffmpeg.jpg";
$cmd['ffmpeg'][] = $tprefix."ffmpeg.jpg";
} elseif ($mode == "icon") {
@@ -95,7 +97,7 @@ foreach ($cmd as $exec) {
$file = pathinfo($exec[1], PATHINFO_FILENAME);
$dir = pathinfo($exec[1], PATHINFO_DIRNAME);
if(!filesize($exec[1])) {
if(!@filesize($exec[1])) {
echo "NO RESULT\n";
} else {
rename($exec[1],$dir."/".$i."_".$file."_".$elapsed."msec.".$ext);