View Single Post
Old 04-20-2006, 09:43 AM   #2 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,529
sde is on a distinguished road
here is a snipped of code i use to create thumbs.
PHP Code:
list($width$height) = getimagesize($filename);

// get the pecent needed to reduce the image height to 56 pixels
$percent = (100 56 $height) * .01;

// set thumb size
$new_width $width $percent;
$new_height $height $percent;

// resample image
$image_p imagecreatetruecolor($new_width$new_height);
$image imagecreatefromjpeg($filename);
imagecopyresampled($image_p$image0000$new_width$new_height$width$height);

$newfile "/path/to/images/gallery/".$image_id.".jpg";
move_uploaded_file($filename$newfile);
chmod($newfile0644);

$array explode(".",$name);
imagejpeg($image_p"/path/to/images/gallery/".$image_id."_t.jpg"); 
sde is offline   Reply With Quote