the random dozen

I don’t have enough images on the website. Coming from someone who has 330 files in their images folder and only 140 pages that may sound a wee bit strange. Cos you figured, that’s averaging over 2 images per page. Not a lot by web standards, but not to shabby either.

Let me rephrase. My images aren’t distributed evenly over the website. That kinda makes sense, after all, pages like the gallery and travels need pictures, and the writing pages don’t need many.

Nevertheless, it’d be nice to have some color on the pages.

On most level 1 pages (that’s the first level down from homepage) plus all of the weblog-powered pages I have this 120×120 image at the top left. Back in html days, I used one image as signature to each section:

homepage: luzernsquare

faq: mushroom

personal: nice chair diffuse

innermost: boat at lake district

hidden doors: bigwheel

delicacies: mara tree glass

I don’t take a lot of photos, and most of them aren’t any good, so as I was creating new sections I began to run out of nice photos to use. Plus they get a boring after a while.

With conversion to php comes the first advantage. I’m now able to generate a random image. There are lots of free scripts for this, I googled and found more than 10 at first pass. The one I’m using comes from Dan Benjamin. It’s simplicity in itself.

Step 1: I saved the images I want to rotate in a separate folder in my images folder. I chose 12 images (hence “the random dozen”), my only criteria was that they were all square, which excluded a couple of favorites, but I’m happy with the selection. I noted the path of this folder: “/images/rotate”.

Step 2: I downloaded the script and saved the php file in the same folder as the 12 images.

Step 3: Since the script and images are in the same folder, and I don’t forsee displaying images other than jpg, gif or png, I didn’t need to make any changes. Had I so wished, the instructions in the script are clear enough.

Stap 4: Where I want the random to appear, I put in this html:

<img src=”/images/rotate/rotate.php” alt=”the random dozen” width=”120″ height=”120″ />

To see the effect, refresh the page a few times and the image below will change.

the random dozen

I kept the changing Macs here on shiny parts but the randomizer is on most of the other pages.