Файл: www/obm/file_video.php
Строк: 17
<?php
include '../config.php';
$fid=intval($_GET['fid']);
$r=mysql_fetch_array(mysql_query("SELECT * FROM `obm_file` WHERE `id`='$fid'"));
$k=mysql_fetch_array(mysql_query("SELECT * FROM `obm_cat` WHERE `id`='$r[id_cat]'"));
$W=80;
$H=80;
$pic='files/'.$k['dir'].'/'.$r['file'];
$mov=new ffmpeg_movie($pic);
$wn=$mov->GetFrameWidth();
$hn=$mov->GetFrameHeight();
$frame=$mov->getFrame(20);
$gd=$frame->toGDImage();
$new=imagecreatetruecolor($W, $H);
imagecopyresized($new, $gd, 0, 0, 0, 0, $W, $H, $wn, $hn);
imagejpeg($new,null,100);
header('Content-type: image/jpeg');
imagejpeg($new);
imagedestroy($new);
?>