some css tweaks and other minor improvements/fixes

This commit is contained in:
noxy
2019-11-27 15:23:48 +00:00
parent 5fc7bf3036
commit 50ba00431b
35 changed files with 880 additions and 104 deletions

View File

@@ -188,6 +188,38 @@ public function tesThumb() {
}
}
public function blurryThumb() {
set_time_limit(9899999999999999);
$dat = $this->file;
#$in = public_path() . "/b"; // webm-input
$in = "/home/sirx/web/devw0bm/w0bm.com/public/b";
$out = public_path() . "/thumbs/blurred"; //thumb-output
$tmpdir = str_replace("public", "app/Http/Controllers/tmp", public_path());
$name = explode(".", $dat);
array_pop($name);
$name = join(".", $name);
#$ffmpegthumbnailer = round(shell_exec("ffmpegthumbnailer -i {$in}/{$dat} -a -o {$out}/{$name}_test.png"));
//$ffmpeg = round(shell_exec("ffmpeg -i {$in}/{$dat} -vf select='eq(pict_type,PICT_TYPE_I)' -vf scale=128:128 {$out}/{$name}_ffmpeg.png"));
$length = round(shell_exec("ffprobe -i {$in}/{$dat} -show_format -v quiet | sed -n 's/duration=//p'"));
$half = $length / 20;
$ffmpeg = exec("ffmpegthumbnailer -i {$in}/{$dat} -o {$out}/{$name}_testblur.png", $output, $return);
if ($return != 0) {
// error
@unlink("{$out}/{$name}_testblur.png");
exec("ffmpeg -i {$in}/{$dat} -vf select='eq(pict_type,PICT_TYPE_I)' -vf scale=128:128:force_original_aspect_ratio=increase,crop=128:128 {$out}/{$name}.png");
exec("convert {$out}/{$name}.png -blur 0x8 {$out}/{$name}_blurred.png");
@unlink("{$out}/{$name}.png");
}else{
// success
@unlink("{$out}/{$name}_testblur.png");
exec("ffmpeg -i {$in}/{$dat} -vf select='eq(pict_type,PICT_TYPE_I)' -vf scale=128:128:force_original_aspect_ratio=increase,crop=128:128 -ss {$half} {$out}/{$name}.png");
exec("convert {$out}/{$name}.png -blur 0x8 {$out}/{$name}_blurred.png");
@unlink("{$out}/{$name}.png");
}
}
public function createThumbnailStatic() {
$dat = $this->file;
$in = public_path() . "/b"; // webm-input