Witam,
Co robię źle, że rozmiar zdjęcia się nie zmniejsza? Chcę je już wysłać zmniejszone na serwer.
<?php
$uploaddir = "zdjecia/";
$namefoto = ''.$user_info[1].'.jpg';
$uploadfile = $uploaddir . $namefoto;
$new_width = 188;
$new_height = 250;
$image_p = imagecreatetruecolor($new_width, $new_height);
$image = imagecreatefromjpeg($foto);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
imagejpeg($image_p, null, 100);
$smarty->assign('title_color','green');
$smarty->assign('message_title','Gratulacje!');
$smarty->assign('message_text','Zdjęcie zostało zaktualizowane.');
$smarty->assign('message_back','/konto/ucp/profil.html');
} else {
$smarty->assign('title_color','red');
$smarty->assign('message_title','Błąd!');
$smarty->assign('message_text','Zdjęcie nie zostało zaktualizowane.');
$smarty->assign('message_back','/konto/ucp/profil.html');
}
?>
Ten post edytował DonJeday 2.11.2008, 11:44:13