photomolo
, jpegcom
,
exifiron
and jpegnail
release notesexifiron
jpegnail
jpegcom
photomolo
image galleryprogram?
If you have a digital camera, you probably have a large amount of
JPEG files
that you would like to publish as a photo album
on a CD-R or on the World Wide
Web.
Simply copying the image files is not adequate. Transferring and decompressing a high-resolution JPEG image can consume several seconds, and the images might not even fit in the screen at full resolution. It would be more convenient to preview the files at a lower resolution.
Another possible problem with a large collection of photographs is that you could forget where a particular image was taken, or what exactly is shown in it. Modern digital cameras usually provide some technical information, such as the time when the image was taken, in the time stamp of the file and in EXIF-formatted JPEG files.
Most file formats for digital pictures offer a possibility to embed textual comments in the files. JPEG is no exception. The documentation or metadata can make a much better browsing experience and enable many possibilities for searching images.
exifiron
Contemporary digital cameras compress images with the JPEG method and store them in EXIF format, which contains a TIFF-formatted APP1 marker that contains metadata, such as camera settings and a thumbnail image.
It is possible to reduce the size of typical image files by five to
ten per cent by removing the thumbnail image and by transforming the
image data (DCT
coefficients) from baseline JPEG to optimised
progressive JPEG. These
operations do not lose any information: the bitmap representation of
the image is unaffected, and the thumbnail image can be reconstructed
from the image data, e.g., with jpegnail
.
The EXIF block contains an Orientation tag that has eight possible values, indicating how the image data has been mirrored or rotated. Most JPEG image tools ignore this information. Thus, in order to avoid compatibility problems with EXIF-ignorant viewers, the image data should be flipped and rotated according to the Orientation information.
Last but not least, the EXIF block contains timestamps that indicate when the photograph was taken. In case the timestamp of the image file in the host file system does not reflect the time when the photograph was taken, the information can be restored from the EXIF block.
The exifiron
program assists in all these tasks. It
corrects the orientation of images—either automatically
according to Orientation tags or as instructed by command line
switches. It can remove and add thumbnail images and convert the
image data between the baseline and progressive formats.
Typical usage scenarios of exifiron
are as follows:
exifiron *.jpg
*.jpg
and set the time stamps from the
DateTime tags if available.exifiron -r 1.jpg 2.jpg
1.jpg 2.jpg
counterclockwise by 90 degrees. The -r
and
-R
flags are useful for processing portrait images.jpegnail
Some graphical file browsers can display embedded thumbnail images as image file icons. If no thumbnail is available, either no meaningful icon will be shown, or one has to be generated and stored somewhere, separately from the image file. It could be more practical to include a reasonably-sized thumbnail image with the image file itself. Digital cameras usually generate thumbnails of 160×120 pixels in size, while the file browser could benefit from slightly bigger icon sizes.
The jpegnail
utility can remove most common variants
of embedded thumbnail images in JFIF and
EXIF image files.
It can embed JPEG compressed thumbnail images in both types of files,
with user defined resolution and compression quality. It has been
tested with the Mac OS X Finder, which makes use of thumbnail images
embedded in EXIF
but not JFIF
files.
The desired size of the thumbnail images can be specified in three
ways: as a bounding box
, giving the maximum image width
(-x
) and height (-y
), or as a fixed height
or width, in which case the width or height will be varied according
to the aspect ratio of the full image. By default, both parameters are
zero, meaning that any existing thumbnails will be removed from the
image files.
The scaling algorithm is linear interpolation, adapted from the
pnmscale
tool. You may obtain sharper images by using
one of the filters implemented in ImageMagick.
jpegcom
In JPEG images, textual comments can be embedded in the COM marker. The file may contain multiple such markers.
Not all utilities for creating or viewing JPEG images allow
comments to be written. Enter jpegcom
, a utility that
allows you to edit image comments with the help of your favourite
image viewer and text editor.
Because jpegcom
was designed to be as simple and
portable as possible, it lacks a graphical user interface. Instead,
the tool is invoked from the command line. Typical usage is as
follows:
jpegcom *.jpg > control.txt
to produce
a template for commenting and renaming or copying the files*.jpg
and add suitable comments
to control.txt
jpegcom < control.txt
to embed the comments
in the imagesThe jpegcom
tool can also be combined with GNU Recode
in order to convert the comments of image files to another character
set: jpegcom *.jpg | recode iso-8859-1..utf-8 | jpegcom
.
The command works if the character sets are supersets of IA5, also known as ASCII, and the image file names are not affected by the
translation.
For details, please refer to the manual page or read the comments
that jpegcom
writes when you invoke it on a single image
file.
photomolo
If the images have been divided into subdirectories of no more than
a few dozen images, photomolo
can create an efficient set
of HTML
documents for navigation. In each subdirectory containing the
full-resolution images, photomolo
creates one
subdirectory for each selected thumbnail type. The thumbnail images
and and the HTML
documents will be written in these directories.
For instance, the command photomolo -T .8/s8 -T .120/h120 -T
.240/h240 images
traverses the directory tree
images
and creates three types of thumbnail images:
shrunk to an eighth of the original resolution (in subdirectories
named .8
), or to 120 or 240 pixels of vertical resolution
(.120
and .240
). You probably want to
create a file images/index.html
that links to
images/.8/index.html
,
images/.120/index.html
, and
images/.240/index.html
.
Since version 1.2, photomolo
creates links to all
files, not only images. For the top-level directory, no links are
generated to other than image files. Thus, in the example above,
there will be no link to images/index.html
from
images/.8/index.html
.
For future reference, you may want to write the
photomolo
command in a shell script or a batch file.
Subsequent runs of the command will be much faster, since thumbnail
images will only be generated if they do not exist or the timestamps
do not match.
For more information, please refer to the manual page or invoke
photomolo -h
.
image galleryprogram?
There are many programs that generate HTML for browsing digital
photographs. photomolo
was written, because its author
was unsatisfied with the existing software. The following design
goals were set:
jpegcom
does not depend on any external libraries.exifiron
, jpegnail
and photomolo
depend on the portable libjpeg
library from the IJG.Graphical interfaces have not been standardised. If a graphical interface were developed, it would have to be adapted and tested on each of the currently available systems, and it might not work on future systems.
Also, a textual interface can be more powerful and flexible than a graphical one, since text files can be processed and generated with a large variety of programs and programming languages.
Some applications implement a graphical user interface in a
client/server architecture, e.g., by combining an HTML browser and a
HTTP server.
One example is Gallery, whose
functionality is similar to that of photomolo
. However, a utility that
relies that some server software is run in parallel with a browser,
requires that a server is always installed and reachable, which can be
problematic.
The main reasons why photomolo
does not support other
image file formats, such as PNG or TIFF is the problem of representing the thumbnail images.
For many bitmap image formats, there are more options than for
JPEG. It
may be difficult to select an efficient set of parameters for storing
the thumbnail images.
JFIF is one
of the most widely supported image file formats in browsers. Should
the thumbnails of a TIFF picture be TIFF, or perhaps JFIF, to ensure that most
browsers can display the thumbnail image? If JFIF is chosen, how
should the thumbnail be named? In applications that recognise files
by their names, a JFIF file file.tif
would
cause problems. Then again, file.jpg
is not
safe either, since there could exist both
file.tif
and file.jpg
in the same directory.
Thumbnail images can also be generated for other than image files,
such as title pages of PDF documents. Such functionality is best implemented in a
scripting language that can make use of existing software packages.
The main design goal of photomolo
is to be compact and
efficient for one type of images.
The primary distribution site is http://www.funet.fi/pub/sci/graphics/packages/photomolo/.
The programs are freely available under the conditions of the GNU General Public License as C source code for all platforms and as executables for Microsoft Win32.
The utilities in the photomolo package were written from the scratch by Marko Mäkelä in 2003.
With the exception of jpegcom
, the tools read and
write JPEG images using libjpeg
from the IJG.
The algorithm for scaling images has been adapted from
pnmscale
by Jef Poskanzer.
The algorithms in exifiron
for lossless JPEG image
transformations have been adapted from jpegtran
of the IJG, written by Thomas
G. Lane and Guido Vollbeding.
The following statement applies to all utilities in the photomolo package:
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. See the GNU General Public License for more details.
Martin Schneider tested versions 1.0 and 1.1 on Win32.
Thomas Kaiser created a Mac OS X installer package. He made many suggestions regarding the exifiron tool, and provided me with sample images from Adobe Photoshop, making it possible to implement the colour space transformations in version 1.2.