<?
include 'config.php';
$time=time();
if(isset($_GET['x']))
$neww=intval($_GET['x']);
else
if($img_v_session)
{
$neww=$img_v_session;
}else{
 $neww=100;   
}
if(isset($_GET['y']))
$newh=intval($_GET['y']);
if($img_s_session)
{
$newh=$img_s_session;
}else{
 $newh=100;   
}
$file=@$_GET['file'];
list(, , $type,)=@getimagesize($file);

if ($type==1) {$funci="imagecreatefromgif";} //$funco="imagegif";}
if ($type==2) {$funci="imagecreatefromjpeg";} //$funco="imagejpeg";}
if ($type==3) {$funci="imagecreatefrompng";} //$funco="imagepng";}
if($type)
{
$im1 = @$funci($file);
$im2=@imagecreatetruecolor($neww,$newh);
@imagecopyresized($im2, $im1, 0,0,0,0,$neww,$newh, @imagesx($im1), @imagesy($im1));

@header("Content-type: image/gif");
@imagegif($im2);
}
?>