Terranova: Details

Adapted by Craig Dewick

Original Work by John Walker


How are the planet images created?

They images are generated using a slightly modified version of the ppmforge program John contributed to Jef Poskanzer's pbmplus toolkit in 1991. Pbmplus eventually became part of a larger package of generic image manipulation utilities called Netpbm, which has been maintained by Bryan Henderson since the middle of 1999.

You can FTP the modified version, which has slight tweaks to the randomisation of parameters, directly from John's site.

The generated image is then scaled to form the large and small images plus the postage stamp icon for the header (as shown above), and encoded into GIF with the pbmplus utility ppmtogif and JPEG using cjpeg, part of the public domain JPEG image compression/decompression package from the Independent JPEG Group. You can FTP the latest version of the IJG's software package from their semi-official archive site.

So, you run this whole lot every day....

No. Well, not directly. Instead, I've followed the way John does it, by scheduling a cron job to create the new planet every day at about 0200 Australian Eastern Standard Time. It executes the following 'terranova.sh' shell script:


#! /bin/sh
#
#   Update Terranova: Planet of the Day
#
# 24-Feb-1999 : updated for move from Lios to Ziri
# 26-Feb-1999 : added line to keep old logo
# 26-Jun-2000 : built new version of netpbm utils - installed in /usr/local
#
cd /home/cdewick/public_html/terranova
#   Create image, save PPM, and make JPEG file
nice -19 /usr/local/bin/ppmforge -width 512 -height 512 -mesh 1024 > /tmp/TN$$.ppm
nice -19 /usr/local/bin/cjpeg -outfile new.jpg < /tmp/TN$$.ppm 
#
#nice -19 /usr/local/bin/ppmforge -width 512 -height 512 -mesh 1024 | \
#         tee /tmp/TN$$.ppm | \
#         /usr/local/bin/cjpeg > new.jpg
#
#   Big GIF image
nice -19 /usr/local/bin/ppmquant -fs 256 /tmp/TN$$.ppm | \
         /usr/local/bin/ppmtogif -interlace > new.gif
#   Logo: 64x64 pixel rendering
nice -19 /usr/local/bin/pnmscale -width 64 -height 64 /tmp/TN$$.ppm | \
         /usr/local/bin/ppmquant -fs 256 | \
         /usr/local/bin/ppmtogif -interlace > newlogo.gif
#   Small GIF image
nice -19 /usr/local/bin/pnmscale -width 256 -height 256 /tmp/TN$$.ppm |
         /usr/local/bin/ppmquant -fs 256 | \
         /usr/local/bin/ppmtogif -interlace > newsmall.gif
rm /tmp/TN$$.ppm
#
#   Install the new images and swap the previous ones to be "yesterday's".
#
rm -f last.jpg last.gif lastsmall.gif lastlogo.gif
ln terranova.jpg last.jpg
ln terranova.gif last.gif
ln small.gif lastsmall.gif
ln mainlogo.gif lastlogo.gif
mv new.jpg terranova.jpg
mv new.gif terranova.gif
mv newsmall.gif small.gif
mv newlogo.gif mainlogo.gif

Terranova Image Generation Script

If you're going to use this script on your own system, be sure to change the pathnames to suit how your system is configured. I like to use full pathnames for things run out of shell scripts just in case something goes wrong with the search path picked up in the environment inherited by the shell.


This page has been accessed times.

If you'd like to ask me anything about this project, please send me some email. If this link doesn't work for you, my email address is 'cdewick@lios.apana.org.au'.


Back to Terranova.