i'm using this code to resize an image posted in a form:
php:
Code: Select all
<?
$uploadedfile = $_FILES['images']['tmp_name'][$key];
$src = imagecreatefromjpeg($uploadedfile);
list($width,$height)=getimagesize($uploadedfile);
$newwidth=600;
$newheight=($height/$width)*600;
$tmp=imagecreatetruecolor($newwidth,$newheight);
imagecopyresampled($tmp,$src,0,0,0,0,$newwidth,$newheight,$width,$height);
$filename = "tmp/". $_FILES['images']['tmp_name'][$key];
imagejpeg($tmp,$filename,100);
imagedestroy($src);
imagedestroy($tmp);
?>Code: Select all
$add = $newdir.$filename;
ftp_put($id_con, $add, $_FILES['images']['tmp_name'][$key], FTP_BINARY);Any ideas?
thanx
Martin