One final note on why I didn't just created static HTML pages to all pictures. That's how the script was born in the first place. I'm very systematic and tidy (no to say obsessive). First time I found pictures and thumbs online there was a directory with 50 pics and a thumbs page that had fifty links to 50 pages all with one IMG tag to one picture. So at the time I thought that was to static (read: messy .. ;-)). So an intelligent script was the solution. What I want it to do eventually is monitor a directory for incoming pictures and have the script do the whole thumbs thing by itself. Practically: I have a cell phone with a camera; I take a picture; I send it to an email adress; After XX seconds you can view the picture online (with a thumbnail and description ofcourse).
Exactly. No need for CGI or another form of pages generated on viewer demand. You'd only generate new pages (and update any indexing/overview pages) whenever a new picture arrives. Seen from the server (and hence the viewer), that's static - the pages are there before the viewer requests them.
| [reply] |
Dear Anonymous Monk,
I'm sorry but I'm missing your point. Are you saying to have a cyclic script just check and create html pages? Instead of the on demand script all together?
Regards,
Gerard.
| [reply] |
What is a "cyclic" script?
What I would do (well, what I do), is generate new, or changed, picture albums if something changes. I can just call my build script and it'll figure out whether there are new pictures, or modified options (descriptions, cropping parameters, whatever) to pictures, and it (re)builds the corresponding html pages, thumbnails, preview, and display size images, adjusting the navigation pages if necessary. Without parameters, it just checks all, but I can also tell it to check certain albums, or even certain images.
Now, I do this by hand because I copy the images by hand from my camera to the machine. But having it trigger from the arrival of an email would be simple (takes, oh, one line to call an external program in about any language, doesn't it?).
I mean, if I have pictures, pic1, pic2, pic3 and pic4, and they have thumbnails th1, th2, th3 and th4, and preview images prev1, prev2, prev3, and prev4, and I'm using html pages pag1, pag2, pag3, and pag4, then that's fairly static, isn't? It's not something you couldn't determine until someone wants to see pic1 or pic2? And it's not going to change if pic5 arrives.
And as an additional benefit, I can distribute an album (which in my setup is contained in a directory tree), be it by sending someone a tar or a zip file, or to burn it on CD or putting it on a memory stick, by just (recursively) copying the directory. Nothing special required for the receiver. No webserver needed. No OS dependency.
| [reply] |