Re: Making Thumbnails

From: Date: Mon, 24 Jul 2000 20:16:10 +0000
Subject: Re: Making Thumbnails
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-7960@lists.php.net to get a copy of this message
> I was planning on implementing a feature similar to this using the GD > library. Your comment makes me curious - what drawbacks would there be with > doing something like this: > > ImageCreateFrom(GIF|JPEG|PNG) > ImageCreate (for the thumbnail) > > Use GetImageSize to determine scaling and positioning (e.g. rather than > distorting, we'd like to center the image on a $Color background) > ImageCopyResized to copy from the source to the thumbnail > > ImageJPEG to store the thumbnail somewhere in the webroot The colour mapping probably won't be as good. GD can only handle 256 colours internally, so if you are making jpeg thumbnails you are limited to 256 colour thumbnails. For me it was just easier to shell out to these familiar tools. It's not like they are created on every request, so I didn't care too much about speed. -Rasmus

« previous php.general (#7960) next »