in reply to Re: Global program flow
in thread Global program flow

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.

Replies are listed 'Best First'.
Re^3: Global program flow
by Mr. Mental (Initiate) on Feb 15, 2005 at 13:36 UTC
    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.
    ~
    ~
    :wq!
      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.

        Dear A. Monk,

        Reading your reply I must admit, having a script that manages the creation and cleanup, etc. rather then one that creates pages on the fly seems a good idea. I especially like the portability (tar .. there you gow) thingy. I'm probably so used to a linux workstation that there's always an Apache server around (there no place like 127.0.0.1 .. :-))

        Since were on the subject. What I recently added to my script was the option to show a description per picture, and if none state: 'no title - name DSC000XX.jpg'. You gave me a lot of new ideas, Thanx for that!

        What I'm looking for is an easy manageble solution. Something like doing an scp or ftp upload of the pictures (since the're alway on my external server), and being able to create the (static) pages and the preview and thumbs via a dynamicly generated GUI (sorry couldn't help myself .. ;-)).

        Do you manage the things you mentioned from a CGI based HTML gui or simply from the CLI.

        Thanx again,

        Regards,

        Gerard.
        ~
        ~
        :wq!