Просмотр файла photo_album_photos.php

Размер файла: 776B
<?
ini_set('error_reporting', 'E_ALL & ~E_NOTICE & ~E_WARNING');
header("Content-type:image/jpeg");
$W = intval($_GET['W']);
$H = intval($_GET['H']);
$user = intval($_GET['user']);
$dir = $_GET['dir'];
$pic = urldecode(htmlspecialchars($_GET['pic']));
$pics = "files/photo_albums/$user/$dir/$pic";
if(substr($pics,0,1)!="."){
if(preg_match("/\.gif$/i", $pics)) $old = imageCreateFromGif("$pics");
if(preg_match("/\.png$/i", $pics)) $old = imageCreateFromPng("$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");
}
}
?>