|
Posted by Flaming Corncob on 08/30/06 13:26
Ok, I think I have something here.. it takes the $src file and makes a
thumb nail image and outputs it to the browser:
$data=getimagesize($src);
$height=150;
$width=$data['0']*(($height)/$data['1']);
if($data['mime']=="image/gif")
{
$image=@imagecreatefromgif($src);
}
else if($data['mime']=="image/jpeg")
{
$image=@imagecreatefromjpeg($src);
}
$thumb=imagecreatetruecolor($width, $height);
imagecopyresized($thumb, $image, 0, 0, 0, 0, $width, $height,
$data['0'], $data['1']);
header("Content-type: ".$data['mime']);
if($data['mime']=="image/gif")
{
imagegif($thumb);
}
else if($data['mime']=="image/jpeg")
{
imagejpeg($thumb);
}
}
Now, the next set of questions... Considering this doesn't help me in
any way the way it works now, it does have promise.. but how it works
now you can't output multiple thumb nails of images at once, at least I
don't think you can. If you can't print multiple images, is it possible
to take what you get here and save it to disk? For example, if I would
upload the source file is it possible that during this process it makes
a smaller copy of the image and saves it to be used as the thumb nail
source?
Next question.. I tried making it gray scale using imagefilter.. didn't
work. Any suggestions?
Thanks.
Navigation:
[Reply to this message]
|