tak. tu masz 2 skrypty.tylko sobie je dostosuj.
<?
function resize($im_file_name){
$im_old = imageCreateFromJpeg($im_file_name);
$th_max_width = 120;
$th_max_height = 120;
if($image_attribs[0]>=$image_attribs[1]){
@$ratio = ($width >= $height) ? $th_max_width/$image_attribs[0] : $th_max_height/$image_attribs[1];
}
else{
@$ratio = ($width < $height) ? $th_max_width/$image_attribs[0] : $th_max_height/$image_attribs[1];
}
$th_width = $image_attribs[0] * $ratio;
$th_height = $image_attribs[1] * $ratio;
$im_new = imagecreatetruecolor($th_width,$th_height);
$th_file_name = strrchr($im_file_name, \"/\"); $th_file_name = substr($im_file_name, 0
, strlen($im_file_name)-4) . '-thumb.jpg'; imageCopyResampled($im_new,$im_old,0,0,0,0,$th_width,$th_height, $image_attribs[0], $image_attribs[1]);
imageJpeg($im_new, $th_file_name ,80);
}
?>
<?
$filejpg= './images/' . $_POST['dzial'] . '/' . date(\"mdYHis\") . '.jpg'; $f = fopen($filetext, \"w+\"); resize($filejpg);
print \"zaladowano\";
}
?>