Fix indentation (spaces -> tabs)
This commit is contained in:
parent
2f380f5d59
commit
b5d005710c
@ -18,43 +18,43 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
class VideoFileHandler extends DataHandlerExtension {
|
class VideoFileHandler extends DataHandlerExtension {
|
||||||
public function onInitExt(InitExtEvent $event) {
|
public function onInitExt(InitExtEvent $event) {
|
||||||
global $config;
|
global $config;
|
||||||
$config->set_default_string('video_thumb_engine', 'static');
|
$config->set_default_string('video_thumb_engine', 'static');
|
||||||
$config->set_default_string('thumb_ffmpeg_path', '');
|
$config->set_default_string('thumb_ffmpeg_path', '');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function onSetupBuilding(SetupBuildingEvent $event) {
|
public function onSetupBuilding(SetupBuildingEvent $event) {
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
$thumbers = array();
|
$thumbers = array();
|
||||||
$thumbers['None'] = "static";
|
$thumbers['None'] = "static";
|
||||||
$thumbers['ffmpeg'] = "ffmpeg";
|
$thumbers['ffmpeg'] = "ffmpeg";
|
||||||
|
|
||||||
$sb = new SetupBlock("Video Thumbnail Options");
|
$sb = new SetupBlock("Video Thumbnail Options");
|
||||||
|
|
||||||
$sb->add_choice_option("video_thumb_engine", $thumbers, "Engine: ");
|
$sb->add_choice_option("video_thumb_engine", $thumbers, "Engine: ");
|
||||||
|
|
||||||
if($config->get_string("video_thumb_engine") == "ffmpeg") {
|
if($config->get_string("video_thumb_engine") == "ffmpeg") {
|
||||||
$sb->add_label("<br>Path to ffmpeg: ");
|
$sb->add_label("<br>Path to ffmpeg: ");
|
||||||
$sb->add_text_option("thumb_ffmpeg_path");
|
$sb->add_text_option("thumb_ffmpeg_path");
|
||||||
}
|
}
|
||||||
$event->panel->add_block($sb);
|
$event->panel->add_block($sb);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function create_thumb($hash) {
|
protected function create_thumb($hash) {
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
$w = (int)$config->get_int("thumb_width");
|
$w = (int)$config->get_int("thumb_width");
|
||||||
$h = (int)$config->get_int("thumb_height");
|
$h = (int)$config->get_int("thumb_height");
|
||||||
// this is never used...
|
// this is never used...
|
||||||
//$q = $config->get_int("thumb_quality");
|
//$q = $config->get_int("thumb_quality");
|
||||||
|
|
||||||
$inname = warehouse_path("images", $hash);
|
$inname = warehouse_path("images", $hash);
|
||||||
$outname = warehouse_path("thumbs", $hash);
|
$outname = warehouse_path("thumbs", $hash);
|
||||||
|
|
||||||
switch($config->get_string("video_thumb_engine"))
|
switch($config->get_string("video_thumb_engine"))
|
||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
case 'static':
|
case 'static':
|
||||||
copy("ext/handle_video/thumb.jpg", $outname);
|
copy("ext/handle_video/thumb.jpg", $outname);
|
||||||
@ -62,8 +62,8 @@ class VideoFileHandler extends DataHandlerExtension {
|
|||||||
case 'ffmpeg':
|
case 'ffmpeg':
|
||||||
$ffmpeg = $config->get_string("thumb_ffmpeg_path");
|
$ffmpeg = $config->get_string("thumb_ffmpeg_path");
|
||||||
|
|
||||||
$inname = escapeshellarg($inname);
|
$inname = escapeshellarg($inname);
|
||||||
$outname = escapeshellarg($outname);
|
$outname = escapeshellarg($outname);
|
||||||
|
|
||||||
$cmd = "{$ffmpeg} -i {$inname} -s {$w}x{$h} -ss 00:00:00.0 -f image2 -vframes 1 {$outname}";
|
$cmd = "{$ffmpeg} -i {$inname} -s {$w}x{$h} -ss 00:00:00.0 -f image2 -vframes 1 {$outname}";
|
||||||
exec($cmd, $output, $ret);
|
exec($cmd, $output, $ret);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user