peteg's blog

Blosxom plugin: img

/noise/blogging/img | Link

(or: reinventing PLog, one piece at a time.)

I wanted to add images to the blog, and as I'm fed up with ImageMagick I was relieved to find that someone has written a more usable replacement for perl called Imager. You'll need to install that first, and it should be as easy as politely asking CPAN to do it for you. Also you'll need interpolate_fancy so you can invoke the method in your stories. Here's the code:

The instructions are in the script. It's still quite rough, and I'll be updating it as I go along. Take a good look at your error logs if things don't work.

The existing Blosxom image plugins are a lot fancier than this; I just wanted something that generates thumbnails and automatically adds the requisite attributes to the img tag. This photo is from my trip up to Berilee last month — if you squint you can see the car ferry at Berowra Waters. The markup is:


<@img.img src="IMG_1667.JPG"
 style="border-style: none; margin: 0 0 10px 10px; float: right; clear: right;" />

which, when run on my iBook, results in the XHTML:

<a href="http://localhost/~peteg/images/IMG_1667.JPG"><
 img src="http://localhost/~peteg/images/cache/tn_IMG_1667.JPG"
 width="93"
 height="70"
 style="border-style: none; margin: 0 0 10px 10px; float: right; clear: right;"
 alt="" /><
/a>

I get the impression that the interpolate_fancy plugin doesn't like having newlines in the arguments.

...and yes, I am vaguely aware that those suckling on the RSS nipple are not getting the full technicolour experience. Bear with me.

Trees ain't trees.

/cs | Link

Any idiot knows a tree has a branching structure, or at least that's what we've been telling the first years since time immemorial. There was a proper CS tree at UNSW back before I got there that the internet doesn't appear to remember so well. This photo of the "right way up" fig is from Geoff Whale's data structures textbook, and carries the following attribution:

Evidence that trees sometimes really are as shown in data structure textbooks. Sculpture using the medium of a dead fig tree at UNSW. Photo by Russell Bastock.

I reproduce it here without permission. That must be the Applied Science building in the background and my guess is that it sat at the eastern end of where the Red Centre is now.

I spotted this purported "tree" on Centennial Avenue, near Avoca St (which runs between Queen and Centennial parks) several months ago but have only now got around to photographing it. I grant that it appears to be a DAG, and is therefore for most purposes a tree.