<?php
$file = intval(trim($_GET['id']));
if (isset($_GET['id']) && is_numeric($_GET['id']))
{
$sql = mysql_query("select * from `download` where type = '2' and id = '" . $file . "';");
$getfile = mysql_fetch_array($sql);
if (($getfile != 0) && (is_file("$getfile[adres]/$getfile[name]") && ereg("(\.3gp|\.avi|\.mp4)",$getfile[name])))
{
$file = "$getfile[adres]/$getfile[name]";
$frame = 24;
$mov = new ffmpeg_movie($file);
$w = $mov->GetFrameWidth();
$h = $mov->GetFrameHeight();
$ff_frame = $mov->getFrame($frame);
if ($ff_frame)
{
$gd_image = $ff_frame->toGDImage();
if ($gd_image)
{
$des_img = imagecreatetruecolor(98, 98);
$s_img = $gd_image;
imagecopyresampled($des_img, $s_img, 0, 0, 0, 0, 99, 99, $w, $h);
imagegif($des_img);
imagedestroy($des_img);
imagedestroy($s_img);
}
}
}
}
?>