{% else-1 %}
Можно решить все, было бы желание:

                        
<? 
///// расмотрим как файл img.php
///// путь на картинку должен иметь вид http://site.com/img.php?file=papka/papka/images.gif&amp;x=100&amp;y=100
/////
$file = $_GET['file']; //// ПУТЬ К ФАЙЛУ КАРТИНКЕ
$neww=intval(@$_GET['x']); /// РАЗМЕРЫ ПРЕВЬЮШЕК ШИРИНА
$newh=intval(@$_GET['y']); //// ВЫСОТА
if(!$neww or !$newh)
{
$neww=intval(@$_POST['x']); //// С ПОСТА ЕСЛИ
$newh=intval(@$_POST['y']);
}
if(!$neww or !$newh) /// ЕСЛИ НЕТ ЗАКАНЧИВАЕМ ВЫПОЛНЕНИЕ СЦЕНАРИЯ НАХЕР
exit;

//// ФУНКЦИЯ ОПРЕДЕЛЕНИЯ РАСШИРЕНИЯ ФЙЛА
function r($r,$t=null)
{
$f=explode('.',$r);
return $f[count($f)-1-$t];
}

if(r($file) == 'jpg' or r($file) == 'jpeg'){
$from = imageCreateFromJpeg($file);
}
if(r($file) == 'gif'){
$from = imageCreateFromGif($file);
}
if(r($file) == 'bmp'){
$from = imageCreateFromBmp($file);
}
$wn = imageSX($from);
$hn = imageSY($from);



//// РАБОТАЕМ НАД РАВНОМЕРНЫМ ИЗМЕНЕНИЕМ ИЗОБРАЖЕНИЯ


$obchee = $hn/$wn;
$w_new=round($neww); // ширина картинки
$h_new=round($neww*$obchee); // высота картинки






$new = imageCreateTrueColor($w_new, $h_new);
imageCopyResampled( $new, $from, 0, 0, 0, 0, $w_new, $h_new ,$wn, $hn);
header("Content-type: image/jpeg");
imageJpeg($new);
?>
0 22 0
Без комментариев...