Re: More efficient thumbnail script

From: Date: Tue, 16 Jan 2007 21:15:18 +0000
Subject: Re: More efficient thumbnail script
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-247184@lists.php.net to get a copy of this message
At 1/16/2007 12:54 PM, Jason Pruim wrote:
First off, thanks to everyone who helped me get started with a thumbnail gallery that would display info you could just copy/paste into a weblog (Or any webpage) and have the picture display. I am moving along with a few additions and seem to be running into a problem. The script I have works just fine, it's just slow when you put some large files in it, the page takes awhile to load weither I'm calling it through the php file it's self or through a include in an html file. ...
The php script I'm using can be seen here: http://www.raoset.com/ tests/picture/images/wheeler.php the html file I want to include it in is: http://www.raoset.com/tests/ pictures/index.shtml
Jason, I'm not able to see your PHP script because when I navigate to the script it is interpreted, not downloaded as text. Please copy the script into a file ending in .txt if you'd like people to be able to read it. Is your thumbnail script slow because you're creating images on the fly every time? If so, an obvious fix would be to cache thumbnails on the server so you only have to create them once. The logic could look something like:
        if (thumnbail doesn't exist)
        {
                // create thumbnail & save it to the server
        }
// use existing file Then you might consider putting the thumbnail-cacheing logic into the script that lets people upload their images in the first place, so there won't be so much processing the first time the thumbnail gallery is loaded. Regards, Paul __________________________ Juniper Webcraft Ltd. http://juniperwebcraft.com

« previous php.general (#247184) next »