 Roundboy Premium join:2000-10-04 Drexel Hill, PA
| Re: thumbnail creation without save?certianly..
I call the image like:
IMG SRC="/makeimage.php?file=$file">
this means call the makeimage.php file with arguments that the php code needs:
makeimage.php :
code:
// set base image $image = "/home/ercdvs/public_html/archive/$id/$file"; $image_info = getimagesize($image); // image specifics $too_big_diff_ratio = $image_info[0]/$max_width; $new_img_width = $max_width; $new_img_height = round($image_info[1]/$too_big_diff_ratio);
// determine image type if($image_info[2] == "2") // JPEG { // This is for resizing JPG only Header ("Content-type: image/jpeg"); $src_img = @imagecreatefromjpeg($image); $dst_img = @imagecreatetruecolor($new_img_width,$new_img_height); imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $new_img_width, $new_img_height, $image_info[0], $image_info[1]); imagejpeg($dst_img,'',90); ImageDestroy($src_img); ImageDestroy($dst_img);
}
This code takes the directory and filename of the big image.. and if it is a jpg, resizes to a max width of 100, and a hieght keeping with the image ratio
I need to write vrey similar code for gif, png, etc.. but 99.9% of m images are jpg.
feel free to copy and ask me any questions. --
Girls are like internet domain names, the ones I like are already taken. Unless you get one from a strange country
I dont know the difference between games and reality anymore ...I just used a shotgun on my mother and she's not respawning |