Gthumpy: Images and Metadata
1 Introduction
[toc]
1.1 About Gthumpy
[toc]
Gthumpy is small collection of scripts for handling images from a
digital camera. One script lets you enter metadata and view picture
(date, description, title) in a GUI and an other creates static HTML
files and thumbnails.
The created HTML files don't need a http server or CGI, you can burn
a CD/DVD and give this to your friends. You only need a webbrowser to
view the created HTML files.
1.2 Supported platforms
[toc]
Gthumpy gets developed on Linux, but should be portable to win32. The
HTML files created with "make-my-pictures.py" can be viewed on any
platform with a webbrowser.
1.3 How to use it
[toc]
Step 1:
Create a directory with all images which belong to one group.
If you use the current date like in the example, the directories
are always sorted in chronological order.
Example:
> cd image-dir
> mkdir 2004-12-31 # or mkdir `date --iso`
> cd $_
> gphoto2 --get-all-files
If your camera is supported by gphoto, you can use the "get" button to this step.
Step 2:
Then have a look at the pictures, rotate, delete and give description
with "editMetadata.py". This is a pygtk GUI:
> python editMetadata.py image-dir/2004-04-14
You can create a "gthumpy.conf" in "~/.config/gthumpy/gthumpy.conf" or in the
source directory. You can set the lanuage and the
image-directory. Look at the default config file.
> python make-my-pictures.py
This scripts creates thumbnails with convert of ImageMagick and HTML
pages. This script behaves like the unix tool "make". If a picture
gets changed, the thumbnails get created again.
1.4 What directory layout should I use?
[toc]
I use a directory for each day I download the images from the camera
to the computer.
image-dir/2006-01-03/IMG1.jpg
image-dir/2006-01-03/IMG2.jpg
image-dir/2006-02-14/IMG3.jpg
image-dir/2006-02-14/IMG4.jpg
At the moment I have 3553 pictures in 111 directories.
2 editMetadata.py
[toc]
This script is a GUI written with pygtk.

The metadata (date, title, description) are saved in a file per image
(IMAGE.gthumpy)
You can display all pictures of a directory (incl. metadata):

You can change the directory and give each directory a description:

2.1 Keyboard Shortcuts for editMetadata
[toc]
- PageUp/PageDown: Previous/Next Image
- Ctrl-p/Ctrl-n: Previous/Next Image
- ESC: Change between fullscreen and normal mode
- Pos1/End (in fullscreen mode): First/Last Image of current directory
- Ctrl-x: Delete current image
- Ctrl-r: Rotate 90 degrees (turn right)
- Ctrl-l: Rotate 270 degrees (turn left)
- Ctrl-u: Rotate 180 degrees (upside down)
3 make-my-pictures
[toc]
This script creates static HTML files from the metadata. There is a
page which lists all directories, a page which lists all pictures of
a directory and a page for each image.
3.2 Which files get created?
[toc]
Taken the example layout from above, this files will be created:
image-dir/index.html # Table with descriptions of all directories
# Created by make-my-pictures.py
image-dir/2006-01-03/index.html # Preview with thumbnails.
# Lists all images of the directory.
# Created by make-my-pictures.py
image-dir/2006-01-03/IMG1_res150.jpg # Thumbnails
image-dir/2006-01-03/IMG1_res500.jpg # Created by make-my-pictures.py
image-dir/2006-01-03/IMG1_res1024.jpg
image-dir/2006-01-03/IMG1.html # HTML-Page for one image
# created by make-my-pictures.py
image-dir/2006-01-03/IMG1.gthumpy # XML file created by editMetadata.py
3.3 JavaScript
[toc]
There is one simple JavaScript method. It marks the text where you
link points you (...#FOO in the URL). This is usefull if you have a
lot of pictures in one directory or a lot of directories in you
image-dir.
3.4 UnicodeError: UTF-8 decoding error: invalid data
[toc]
The default encoding for XML is UTF-8. You should use
<?xml version="1.0" encoding="iso-8859-1"?>
as the first line of your foo.gthumpy files if you want to
use german umlauts. Edit "template.gthumpy"
3.5 Templates
[toc]
- template.gthumpy is used by editMetadata for new pictures.
- template_picture.html is used for the slide show
- template_preview.html is used for the overview ot the directory
3.6 How do the created HTML files look like?
[toc]
http://guettli.sf.net/gthumpy/example
4.1 How can you translate it an other language?
[toc]
At the moment german (de) and english (en) are supported. You need to
create a new file in the language directory "lang" and edit the
templates. Have a look at "de.py".
4.2 What libraries/programs does gthumpy use?
[toc]
4.3 What licence is used by gthumpy?
[toc]
Gthumpy is in the public domain. You can use it under any open source
licence. If you like it, send me an email!
4.4 There are already many scripts, which do things like this. Why did you do it again?
[toc]
- Most scripts for HTML pages need a http server. I want to create
HTML pages as simple static files.
- I like python programming.
4.5 Where do I post corrections, typos and feedback?
[toc]
guettli@thomas-guettler.de
4.6 Where can I get it?
[toc]
http://guettli.sf.net/gthumpy/download