Re: thumbnail creation
| From: | Matt McClanahan | Date: | Thu, 28 Dec 2000 00:32:38 +0000 |
| Subject: | Re: thumbnail creation | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-32026@lists.php.net to get a copy of this message | ||
On Wed, 27 Dec 2000, Marc Davenport wrote:
> I'm not sure how to do this. I'm trying to take in pictures from a form
> and then create a thumbnail of the picture. I can resize the picture, but
> I just cant find the right function to save the picture. I found lots of
> code to resize and shhow the picture but none that lets me save it. I'm
> sure its not to hard, the answer is just eluding me.
If you've resized an image with ImageCopyResized, you can save it with
ImageJPEG, ImagePNG, etc.
For example,
$src = ImageCreateFromJPEG('screenshot.jpg');
$thumb = ImageCreate(100,100);
ImageCopyResized($thumb,$src,0,0,0,0,100,100,ImageSX($src),ImageSY($src));
ImageJPEG($thumb,'thumb.jpg'); // Here, we've saved $thumb to a new file
Matt