File size: 750B
<?
ini_set('error_reporting', 'E_ALL & ~E_NOTICE & ~E_WARNING');
header("Content-type:image/jpeg");
$W = intval($_GET['W']);
$H = intval($_GET['H']);
$dir = urldecode(htmlspecialchars($_GET['dir']));
$kat = urldecode(htmlspecialchars($_GET['kat']));
$pic = urldecode(htmlspecialchars($_GET['file']));
$pics = "files/exchanger/$dir/$kat/$pic";
if(substr($pics,0,1)!="."){
if(preg_match("/\.gif$/i", $pics)) $old = imageCreateFromGif("$pics");
if(preg_match("/\.jpg$|\.jpeg$|\.jpe$/i", $pics)) $old = imageCreateFromJpeg("$pics");{
$w = imageSX($old);
$h = imageSY($old);
if($W=="" and $H==""){
$W=round(40);
$H=round(40);
}
$new = imageCreateTrueColor($W, $H);
imageCopyResized($new, $old, 0, 0, 0, 0, $W, $H, $w, $h);
imageJpeg($new,"","100");
}
}
?>