I am taking your advice.
I am going to rezize any image greater than 400px wide prior to upload. I
have to combine my upload script
for ($i=0; $i <$total; $i++) {
$fileName = $_FILES['userfile']['name'][$i];
$tmpName = $_FILES['userfile']['tmp_name'][$i];
$fileSize = $_FILES['userfile']['size'][$i];
$fileType = $_FILES['userfile']['type'][$i];
$position=$i+1;
$img_url = "images/$customer_id/". basename(
$_FILES['userfile']['name'][$i]);
if(move_uploaded_file($_FILES['userfile']['tmp_name'][$i], $img_url)) {
chmod('images/'.$customer_id, 0777);
chmod($img_url, 0777);
}
with my resize script
$image = imagecreatefromjpeg($img_url);
if ($image === false) { exit; }
// Get original width and height
$width = imagesx($image);
$height = imagesy($image);
// New width and height
$new_width = 200;
$new_height = 150;
// Resample
$image_resized = imagecreatetruecolor($new_width, $new_height);
imagecopyresampled($image_resized, $image, 0, 0, 0, 0, $new_width,
$new_height, $width, $height);
Any ideas how to save the imagecopyresampled() to the folder?
T
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php