From: Richard L. <ce...@l-...> - 2007-01-29 21:05:06
|
On Mon, January 29, 2007 12:38 pm, Melanie McClusky wrote: > I create a custom "photo gallery" . Currently my client upload a > thumbnail > and the regular size image. Now my client only wants to upload a > regular > size image and have the "system" automaticly create a thumbnail. > > I have not idea how to do this, into the code I already have. Do any > of you > know how? exec with convert is very powerful, but can have performance issues, as firing up exec with a mini-shell can get kind of expensive. Here is a thumbnail script I use: http://uncommonground.com/thumbnail.phps Here's the pathinfo.inc file referenced within that: http://uncommonground.com/pathinfo.phps It also adds a "credits" sidebar using the colors set by the site owner in the database, so you can probably ignore that. Pretty much every photo you see on http://uncommonground.com/ runs through this script, and that gets about a half million hits a month... Except the calendar page, where I pre-generate the thumbnails by hand, as there are so many, and because I want an extreme close-up rather than just a shrunken blob. If you're getting more traffic than that, you may want to consider running a cron job to thumbnail them once -- I don't do that, as we haven't quite reached the stage where we need that, but you might. -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? |