note 27737 deleted from function.imagecopyresampled by aidan

From: Date: Mon, 04 Oct 2004 09:44:56 +0000
Subject: note 27737 deleted from function.imagecopyresampled by aidan
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-77963@lists.php.net to get a copy of this message
Note Submitter: richard at 900network dot co dot uk ---- Here's a nice simple sub for making resampled thumbnails to a certain size and leaving the original next to it: function uploadimg($image_path, $image_id, $file, $width, $height, $compression) { copy($file, "$image_path/$image_id.jpg"); $src_img = imagecreatefromJPEG("$image_path/$image_id.jpg"); $new_h = $height; $new_w = $width; $dst_img = imagecreatetruecolor($new_w,$new_h); imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $new_w, $new_h, imagesx($src_img), imagesy($src_img)); imagejpeg($dst_img, "$image_path/s_$image_id.jpg", $compression); } it's all pretty self explanatory :-)

« previous php.notes (#77963) next »