File size: 2.58Kb
<?php
#********************************** AgS MOD DOWNLOAD CENTR SEA *************************************#
#***************************************************************************************************#
# /||||||||||||||| ********************* /||||||||||||||| ********************* /||||||||||||||| #
# | ||||||||||||||| ********************* | ||||||||||||||| ********************* | ||||||||||||||| #
# | |||||/////||||| ********************* | |||||///////// ********************* | |||||///////// #
# | ||||| | ||||| ****** E-MAIL ******* | ||||| ****** WAP/WEB ****** | ||||| #
# | ||||| | ||||| *** [email protected] *** | ||||| * http://ags.h2m.ru * | ||||||||||||||| #
# | ||||| | ||||| ********************* | ||||||||||||||| ********************* | ||||||||||||||| #
# | ||||| | ||||| ********************* | |||||/////||||| ********************* |///////////||||| #
# | ||||||||||||||| ****** SKYPE ******** | ||||| | ||||| ***** MOD AUTHOR **** | ||||| #
# | |||||////|||||| ***** agrizz15 ****** | ||||| | ||||| ***** Agris Cišs **** /||||||||||||||| #
# | ||||| | ||||| ********************* | ||||||||||||||| ********************* | ||||||||||||||| #
# |///// |///// ********************* |/////////////// ********************* |/////////////// #
#***************************************************************************************************#
#********************************* MOD by AgS in 2010 @ LATVIA *************************************#
require_once"system/start.php";
require_once"system/config.php";
require_once"system/db.php";
$W = intval($_GET['W']);
$H = intval($_GET['H']);
$id = intval($_GET['id']);
$file_info = mysql_fetch_row(mysql_query('SELECT TRIM(`path`) FROM `'.$MY_pre.'faili` WHERE `id` = '.$id.' LIMIT 1'));
$pic = urldecode($file_info[0]);
$name = $setup['dir_video'].'/'.str_replace('/','--',$pic).'.gif';
$location = 'http://'.str_replace(array('\\','//'),array('/','/'),$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']).'/'.$name);
if(file_exists($name)){
header('Location: '.$location, true, 301);
exit;
}
$mov = new ffmpeg_movie($pic, false);
$wn = $mov->GetFrameWidth();
$hn = $mov->GetFrameHeight();
$frame = $mov->getFrame(20);
$gd = $frame->toGDImage();
if(!$W and !$H){
$size = explode('*',$setup['prev_size']);
$W = round(intval($size[0]));
$H = round(intval($size[1]));
}
$new = imageCreateTrueColor($W, $H);
imageCopyResampled($new, $gd, 0, 0, 0, 0, $W, $H, $wn, $hn);
imageGif($new,$name);
header('Location: '.$location, true, 301);
?>