View Single Post
Old 12-09-2003, 11:49 AM  
pornanza
Confirmed User
 
Join Date: Jul 2003
Location: East Village
Posts: 238
you can just set &ltimg src="" width="350"&gt but each user will be downloading the full image = slow & more bandwidth

the following code will thumbnail the image

PHP Code:

 
function resize($width$image$photoFolder$thumbFolder) {
  
$size getimagesize("$photoFolder/$image");

  
$length = ($size[1] * round($width $size[0] * 100)) / 100;

  if (
$length $width) { $length $width$width = ($size[0] * round($length $size[1] * 100)) / 100; }

  
$source imagecreatefromjpeg("$photoFolder/$image");
  
$destination imagecreatetruecolor($width$length);

  
imagecopyresampled($destination$source0000$width$length$size[0], $size[1]);
  
imagejpeg($destination"$thumbFolder/$image"75);
 } 
ryan
__________________
Eskimo Hoe
QuickWank
Pornanza!
pornanza is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote