Re: Re: outputing image part 2

From: Date: Fri, 15 Jun 2007 21:40:37 +0000
Subject: Re: Re: outputing image part 2
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-257145@lists.php.net to get a copy of this message
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

« previous php.general (#257145) next »