Re: More efficient thumbnail script

From: Date: Tue, 16 Jan 2007 21:10:15 +0000
Subject: Re: More efficient thumbnail script
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-247182@lists.php.net to get a copy of this message
generating/resampling image data is a relatively heavy job for a script to perform. there maybe optimizations available in the script itself but generally caching the results the generation/resampling action is the way to increase performance ... you need a mechanism to check/store/retrieve cached images [and a way to automatically regenerate a cached image when the source image has changes]. another thing to consider on top of caching is to store the cached data on a 'ram' drive ... on linux I often use a sub directory on /dev/shm (which is a part of the filesystem which actually exists only in shared memory - more than likely that you dont have access to this on a shared hosting environment. Jason Pruim wrote: > Hello, > > 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. > > I don't know enough about php (read: Hardly anything) to figure out if > there is an issue with the script that I'm using or if it's the hard > ware that is the problem. > > 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 > > My goal for this script, is to have it so that you can upload pictures > into a specific directory, see the images display in a thumbnail format > on the screen, and be able to delete the file if you did the wrong one. > I know there are places like flickr that can do all of this, and it's > free. But I'm in it much more so for the knowledge of learning how to do > it. > > my php version is 4.4.1 and I'm running on a Power PC 1.2Ghz processor > with 1.0 Gb of ram and 2 300gig HD stripped into a raid array to provide > redundant backup. > > Anyway.. Let me know if there is any more info you need and thanks in > advance for any help or pointers you could give! > > As always "RTFM" is okay just please point me to the right "FM" ;) > > > -- > Jason Pruim > japruim@raoset.com > Production & Technology Manager > MQC Specialist (2005 certified) > 3251 132nd Ave > Holland MI 49424 > 616.399.2355 > www.raoset.com > > > "We hold these truths to be self-evident. That all men are created > equal, that they are endowed by their creator with certain unalienable > rights, (and) that among these are Life, Liberty, and the pursuit of > Happiness." > >

« previous php.general (#247182) next »