performance hit using imagecreatetruecolor

From: Date: Tue, 14 Sep 2004 03:22:49 +0000
Subject: performance hit using imagecreatetruecolor
Groups: php.general 
Request: Send a blank email to php-general+get-196587@lists.php.net to get a copy of this message
I'm working on a website where I'd like to display a thumbnail from a repository of jpg's of normal (@ 800x600 px) size. Each time a user comes to this page, I'd like to show a new thumbnail from a different image in the repository. Obviously I could simple resize all the jpg's to my desired size and stick them in a thumbnail-repository and randomly call them up. I'm o.k. with this approach and will probably do it. But I've also played around with imagejpeg and imagecreatetruecolor, and have put together a small function that takes a jpg from the repository, sizes it to thumbnail, and then displays it in the browser. This is real slick and a nice solution, but is there a performance hit there that might slow down page loads for viewers? I know it's all server-side, but my impression is that resizing pics is generally CPU intensive and takes a second or two. Would appreciate any insights. Thanks Kevin

« previous php.general (#196587) next »