Creating HTML Picture Galleries with Picfolio and Image Magick

July 19, 2008

Perhaps I am old-fashioned, but I like to have picture galleries that can be burned to CDs and DVDs and viewed both in DVD-Players and computers.

Furthermore, I want that to run automatically, script-based. Most of the available programs either require a database or user interaction, thus some years ago I found picfolio, a small tool that runs on Linux and contains XML-based configuration and templates. Together with the tools from the Image Magick package I build a little shell script that does exactly the job I need.

Sadly, Picfolio seems to have vanished from the web, but luckily I have both the src.rpm and the Suse RPM here. And they are running on every Suse box since Version 9.x.

Here is what I need to do on a new system to get Picfolio running:

  • Install the picfolio-RPM.
  • Copy my three preconfigured XML-Files to ~/.picfolio
  • Create a “picfolio root configuration” in the gallery directory (not necessary, but safer..) This directory named picofolio contains a file named config.xml.
  • Execute the gallery script I created (see below)

After that, I have index files with previews, clickable photo pages, the images are rotated according to their exif informations. The latter are also displayed in the gallery. Furthermore, all images hava a watermark with my copyright and e-mail-adress. the script seems robust (at least according to my limited coding skills :-) …), and it works with thousands of images. However, there are some ugly recursive chown and move-commands, so use it at your own risk only!

This is my config.xml:

<?xml version=”1.0″?>
<config root=”yes” version=”0.3.1″>
<nails thumbnail-size=”128″ midnail-size=”640″/>
<stylesheets index=”/home/mfeilner/.picfolio/index.xsl” page=”/home/mfeilner/.picfolio/page.xsl”>
<param name=”image-columns” select=”‘5′”/>
<param name=”subdir-columns” select=”‘4′”/>
</stylesheets>
<index max-images=”20″ sort-by=”title”/>
<track-mtime count=”6″ sort-by=”title”/>
<subdirs/>
</config>

The picfolio.xml is created automatically and holds a list of images found.

Here comes my create-gallery script:

#! /bin/bash
#######################################################
#
# Das Programm “convert” wandelt Bilddateien in Webfähige Bilder um:
# Befehlssyntax zur Umwandlung von Digicam-Bildern in webfähige Gallery-Vorlagen ans shell:
# for i in *JPG; do convert -resize 800×533 -quality 50 -font helvetica -pointsize 20 -fill grey -draw “text 250,510 ‘Property Of Markus Feilner 2005′” $i `basename $i .JPG`_small_wasserzeichen.JPG; done
#
# Das folgende Skript wandelt .JPG Dateien (Canon EOS 300 D)
# auf 800×533 pixel, 50% jpg-qualitaet um
#
# Die Dateien werden mit Wasserzeichen versehen
# und anschliessend mit “jhead” anhand der exif-informationen aus den Bildern rotiert.
# Die großen Originalbilder werden gelöscht.
# Das Programm picfolio erstellt dann eine Bildergalerie mit den Informationen aus den lokalen und den # XML-Vorlagen in /usr/share/picfolio - vor allem de HTML-Schnipseln aus der Datei master.xml.

# Ausserdem werden in den lokalen Verzeichnissen XML-Dateien hinterlegt,
# die für die einzelnen Galerien Definitionen enthalten.
#
# Meine Kamera liefert die Bilder mit .JPG - Erweiterung, um “.jpg” Dateien aus allen
# Unterverzeichnissen in “.JPG” umzubennen, dient z.B. die Schleife hier:
# for i in `find -name *jpg`; do mv $i `echo $i | sed s/.jpg/.JPG/g` ; done
#
#
#
#######################################################
# Zwei Pfad-Variablen definieren
workdir=`pwd`
dirs=`find $workdir -type d`
JPG_total=0

# Die Schleife, die uns in die Verzeichnisse führt…
for d in $dirs
do
cd “”$d”"
# Wo sind wir denn gerade?
echo “Suche nach .JPG Dateien in $d:”
# Ein test, damit das folgende nur ausgeführt wird, wenn überhaupt .JPG-Dateien da sind.
# - und etwas Statistik sammeln …
JPG_amount=`ls -l | grep JPG | wc -l`
JPG_total=$(( $JPG_total + $JPG_amount ))
echo “$JPG_amount .JPG Dateien gefunden.”
if (( $JPG_amount > 0 ));
then
# für jedes JPG die conversion anstossen. Vorher noch dem Besitzer Schreibrechte geben.
JPGs=`find *JPG`
for i in $JPGs;
do echo “$i found in $d, … converting…”
chmod u+w -R $i
# für waagrechte und normale Bilder:
/usr/bin/convert -resize 800×533 -quality 80 -font helvetica -pointsize 20 -fill grey -draw “text 10,510 ‘(c)
Property Of Markus Feilner, mfeilner@feilner-it.net‘” $i `basename $i .JPG`_sw.jpg;
# das gleiche für hochkantige Bilder… vielleicht braucht man das mal …
#/usr/bin/convert -resize 533×800 -quality 80 -font helvetica -pointsize 20 -fill grey -draw “text 10,760 ‘(c) Property Of Markus Feilner, mfeilner@feilner-it.net’” $i `basename $i .JPG`_sw.jpg;
echo “$i wurde gelöscht.”;
rm $i;
done;
else
# Sonst ist nichts zu tun.
echo “Keine JPG-Dateien in diesem Verzeichnis gefunden.”
fi
# Jhead rotiert die Bilder, nach den Exif-Informationen
find *jpg -exec /usr/bin/jhead -autorot {} \;
cd $workdir
done

#picfolio erstellt eine Galerie und gibt ausführlich Auskunft.
echo ‘Erstelle Galerien und Untergalerien mit picfolio:’
/usr/bin/picfolio -v
echo “Fertig. $JPG_total .JPG Dateien umgewandelt.”


Kmymoney in usability survey

July 17, 2008

Pallavi Damera has published an in-depth review on the usability of the finance management software Kmymoney in her Blog.

Kmymoney often is referred to as the best free Quicken replacement on Linux. Damera had a concise look at Design, Logik and organization of the program.

Developers will find the "Checklist for design review" very helpful for programming projects where GUI design is involved.


Markus Feilner’s 2nd Book available - again, it’s in English, and on Scalix Groupware

July 17, 2008

Markus Feilner has published his newest book: This time, he took a deep look into Scalix Groupware.

Scalix Administrator's Guide

This software is in parts open source, and is one of the few mail and groupware servers that can serve the needs of fortune 500 companies.

This is not and it never was the realm of Microsoft, this is where Unix and Linux became big. This is about high-availability, stability, scalability and quality. Thousands of users on one server, automatic replication and high-end-clustering.

Furthermore, Scalix is said to have better Outlook support than Exchange itself - if you want to get the full picture, have a free look at it here.


Power User’s Guide to Firefox

June 24, 2008

A good read with a lot of information for Firefox geeks is the Power User’s Guide to Firefox. Solve your Firefox problems, customize the Mozilla browser, give it new and individual skins or speed it up, when it runs too slow or freezes.


Linux4afrika switches to x2go

June 24, 2008

Hans-Peter Merkel from Linux4afrika yesterday called me and told me that the X2go-training that Heinz Graesing (from the City of Treuchtlingen) had held was such a big success that the whole project will introduce x2go in the next weeks.

X2go is a Linux Terminal Server software that runs out-of-the-box supports smartcards for authentication, suspended sessions and a central LDAP-directory. It is often referred to as the opensource, linux-based alternative to Sun’s high-price Sun Ray systems. X2go works also with low-cost, old hardware or thin clients.

Linux4afrika supports third world countries by providing schools and other educational organisations with complete terminal servers and thin clients. A linux based infrastructur like Edubuntu helps teaching african children modern internet usage. Heinz GRaesing has written an excellent article in the Linux Technical Review "06 Server Based Computing" on X2go.


Open Source and the Simpsons - From the Red Hat Summit

June 23, 2008

According to Informationweek.com , Joel Cohen, writer for the Simpson’s TV show, held his keynote on the Red Hat Summit and explained how Open Source influenced the creative progress of the Simpsons.


Washington Post: Mobile Developers choose .NET and Java, Linux is on the Rise

June 21, 2008

The Washington Post cites Evans Data, stating that Linux is third choice, among Mobile Developers but steadily growing. The Paper says that .Net and Java lead are first in popularity, but the marketshares of Linux, Android and Mac OS are constantly growing.


Florian Fainelli’s Openwrt Speech at Fosdem 2008

June 21, 2008

Florian of the Openwrt Project has published papers and sources of the speech he held at the FOSDEM 2008

Openwrt is a recommendable, easy-to-use and feature-rich embedded Linux Distribution for many WLAN/DSL Routers,


Study: Microsoft Vista not adopted in business

June 20, 2008

A Survey (from the Microsoft IT Community itself) shows what consultants have been noticing for months: Vista is not accepted in companies: Few Have Plans To Migrate to Vista in 2008.


Study: Chances and Models for GIS Companies

June 19, 2008

Geobusinessmaps.org has released a study about chances and possibilities for companies doing Geographic Information Systems Services. According to the study, Googleearth has mobilized a huge new market.

The study can be found here.