When I got my digital camera, I found that there was relatively spotty support for it under Linux. Some things were easy to do (e.g., displaying pictures), some were possible but inconvenient (e.g., rotating pictures 90 degrees), and some were very difficult or impossible. Over the next year, I located some software, modified some, and wrote some. This page contains the results of those efforts.
Notes on this software:
xv
is distributed under its
own license.
I'm a big believer in not reinventing the wheel. To use the other software on my page, you will need to download and install the following (unless you have it already):
xv
image viewer. Even if you already have
xv, you will want to download the sources so you can apply my
patches (see below).
metacam
camera-information
dumper. This handy utility will tell you the date and time
your picture was taken, the shutter speed, etc.
jpegtran
tool for doing image rotations
and the rdjpgcom/wrjpgcom
tools for processing
JPEG image comments. Both of these are part of the jpeg-6b
package of JPEG tools from the Independent JPEG group.
The above tools are very useful (as are some other things like The Gimp, but I wasn't satisfied. In
particular, my "Exif tags" (the information appended by the camera,
and read by metacam
, above) weren't being preserved.
Here's what I've done:
xv
to make it more friendly to modern
digital cameras and displays. The exact changes are listed below.
rdjpgcom
and wrjpegcom
to
support application-specific markers, especially the APP1
marker used by digital cameras to hold Exif tags. The patches should be applied to the JPEG
tool sources listed above. See the wrjpegcom
manual page for an example of usage.
camrename
,
that renames picture files from the bad names produced by most
cameras to names that contain the time and date of the
picture. "camrename *.jpg
" is enough to do the
job in most cases. See the comments in the script for documentation.
Note that
jhead
can also do this sort of renaming, but it doesn't preserve
sequence numbers, so I prefer my own script. You must have
metacam
installed to use camrename
.
camrotate
,
that provides a "syntactic sugar" wrapper around
jpegtran
to make it easy to rotate images.
NOTE: camrotate
is obsolete. Use
jhead
instead; it is more powerful and flexible. If you want to use
camrotate
anyway,
"camrotate *.jpg
" will rotate everything 90 degrees
clockwise, and "camrotate -ccw *.jpg
" will rotate it
counterclockwise. See the comments in the script for full
documentation. (Note: if the image contains a thumbnail in
the Exif section, that thumbnail will NOT be rotated.)
camcomment
, that allows you
to easily add commentary to your pictures. Use
"camcomment *.jpg
" to bring up your favorite
editor on a scratch file where you can write comments about
all of the pictures. I also bring up an image displayer so I
can look at the pictures as I write them up. Don't delete the
information in the scratch file; simply add comments after
each title line and exit your editor. (If you delete a title
line, the associated image won't be changed.) As usual, full
documentation is in the script's comments.
copyexif
, that allows you to
copy the Exif tags from one JPEG file to another.
NOTE: copyexif
is obsolete. Use
jhead
instead; it is more powerful and flexible. If you want to use
copyexif
anyway,
copyexif source.jpg dest.jpg
will copy the digicam
information
from source.jpg to dest.jpg. This script requires my modified
versions of rdjpgcom and wrjpgcom.
redeye
,
that corrects red-eye in photographs. To use it, you will
need to have Gimp perl support installed on your system. On
SuSE Linuxes, this is encapsulated in the "gimpperl" package.
Copy the
plug-in to ~/.gimp-1.2/plug-ins/redeye
, make it
executable (chmod +x ~/.gimp-1.2/plug-ins/redeye
),
and then
restart The Gimp. Drag a
selection box around the red area (it's OK to pick up a bit of
the rest of the eye). Usually you'll want to do both eyes at
once, so use the shift key to add a second selection around
the red in the other eye. Then right-click on the image to
bring up a menu, and select Filters->Misc->Auto Red-Eye. The
red-eye will magically disappear. For more control, you can
try Filters->Misc->Red-Eye, which will pop up a dialog box
that allows you to adjust the sensitivity of the red-eye
correction (but the default is usually correct).
NOTE: redeye
works with Gimp
1.2. If you are running Gimp 2.0, you should use the much
nicer (and faster) C-language
redeye plugin by Robert Merkel. To use it, download it
into a handy directory, and then run "gimptool-2.0
--install redeye.c
". (This assumes that gimptool is
properly configured, which may require downloading the Gimp
sources. On my SuSE system, I just had to install the
"gimp-devel" package.)
I have long preferred the xv
image viewer for looking at
my images. It is fast and flexible, and the "presets" in its color
editor (type "e") can be configured to correct the poor color balance
of my camera (tip: try fiddling with the gamma values for the three
colors). I extended it in a number of ways. To get my extensions,
download the patches, apply them to the source
with patch
, and recompile and reinstall xv
.
Unfortunately, the author of xv
has disappeared so I
can't get my changes integrated into the main code stream. Another
side effect is that I can't patch the official documentation, since it
was written with MS-Word and is not distributed in source form. So
here's a summary of my changes and how to use them:
xv
's Visual Schnauzer
has been made variable, and the default is now larger. To
change the thumbnail size, select "Choose icon size..." from
the "Misc. Commands" menu in the Visual Schnauzer. You will
be prompted for a new icon width; the height is chosen
automatically. If you want Gimp compatibility, choose a width
of 80. You'll need to choose "update" to get new icons after
you pick a new size. (Note: due to the way xv
handles JPEG images, there is a compile-time limit on JPEG
thumbnail sizes. You can pick a larger size, but
xv
won't display the bigger thumbnails.)
I'm still searching for Linux-based solutions to a few remaining problems relating to digital photos:
You are visitor number since April 6th, 2003.
Geoff Kuenning's home page.
This page maintained by
Geoff Kuenning.