Файл: masteram_us/fo/ffmpeg.php
Строк: 23
<?
require'../config.php';
header('Content-type: image/jpeg');
$W = check(intval($_GET['W']));
$H = check(intval($_GET['H']));
$file = check(intval($_GET['file']));
$file_info = mysql_fetch_array(mysql_query('SELECT TRIM(`path`) FROM `fo_files` WHERE `id` = '.$file.' LIMIT 1'));
$pic = urldecode(htmlspecialchars($file_info[0]));
if(substr($pic,0,1) != '.'){
$mov = new ffmpeg_movie($pic, false);
$wn = $mov->GetFrameWidth();
$hn = $mov->GetFrameHeight();
$frame = $mov->getFrame(3);
$gd = $frame->toGDImage();
if(!$W and !$H)
{
$size = explode('*',$set['prev_size']);
$W = round(intval($size[0])); // ширина картинки
$H = round(intval($size[1])); // высота картинки
}
$new = imageCreateTrueColor($W, $H);
imageCopyResized($new, $gd, 0, 0, 0, 0, $W, $H, $wn, $hn);
imageGif($new,null,100);
}
?>