Birth of the Gallery

No, no, no – put away the pointy-ear caps, you Trekkies: Birth of the Gallery, not Galaxy.

As I’ve mentioned, I’ve been incorporating some pictures of mine into this blog, including a random “Pic ‘0 the Day” (see left-hand column).

OK, so I had all these pics scanned in and uploaded, but … only one a day would appear.

Which was nice, but why not make a gallery of the pictures?

Better yet, how about multiple galleries – the pictures grouped by subject matter or what have you?

Yeah, why not?

So I worked on a method to get this working, and I have half of it done: the user-presentation layer.

Enter the Gallery, and feel free to browse around.

OK, as mentioned, I have only half the project done: the part posted. Since I’m on Blogger and run off their database (for text only, not other stuff), I have limitations.

And my host does not allow databases on my plan (didn’t allow them at all until just recently), and the scripting languages supported are thin: Basically, this is a job for Perl and flat files.

It all came together fairly easily; I’m surprised that it worked well. I built it remotely and uploaded it and it worked flawlessly the first time. Wow. That’s cool.

  • I have one file that is the list of all images (image name), title and description (since all images are in one directory, file names are unique). Call it the caption list.
  • Another file is the list of galleries – the name of the .txt file that lists the gallery contents, the gallery name and gallery description. Currently, only four lines (four galleries)
  • One .txt file each for every gallery; just a list of images in the gallery (the caption file contains the details, with the image name acting as the flat-file equivalent of primary/foreign key).

In this way, I can build galleries with whatever images exist; images can exist in more than one gallery – however, the title and description always resides in the caption file, so maintenance is trivial.

Ah, maintenance. That’s the second part.

How to maintain that – on my personal machine – and then push to the Web site daily (or whatever period I pick).

While flat files work great with Perl on my host, maintaining flat files doesn’t make a lot of sense. This really calls for a database app that pushes the data to flat files for publication.

Otherwise, it will be quite difficult to control.

So I’m thinking of building it as a PHP-mySQL application on my local machine. Build tools to add/alter the galleries, and then have a tool push the changes to my host.

Hmm…will be interesting.

Until then, enjoy what I have. I enjoyed building it, the twisted fool I am…