Steve Thompson
Some notes on using a digital camera with a digital computer.
Linux has many good tools to help tame your growing photo collection and keep the photos looking sweet. My digital photos have a 4-stage life-cycle:
Stage 3 will be covered here; three pieces of software are used for the task: GQview (for quick and easy viewing of the pictures), jhead (to manipulate the EXIF information), and the GIMP (the program used to actually edit the photos).
I've been using the following system for a few years now. It has evolved to solve certain problems encountered along the way. First, itchy trigger fingers can result in an overwhelmingly large number of photos. Systematic steps must be taken to tackle the problem. Second, file names from the camera can be cryptic and nonsensical. A method must be developed to give each photo a unique name, chronologically ordered. Lastly, raw pictures from the camera usually need cropping, color balancing, brightness/contrast adjusting, etc. Taking the time to do this results in more interesting photo albums. The following tasks are performed, periodically, to manage and build the photo collection.
/directory1.
/directory1
contains photos that are to be edited. Rename the photos with
a unique date/time format. Using the jhead command
jhead -nf%Y%m%d_%H%M%S ./*.jpg,
assuming you are in /directory1, will rename all
the photos in the directory. jhead uses the photo's EXIF information
to give it the name YYYYmmdd_HHMMSS.jpg; for example,
20030821_132302.jpg if it were snapped on 21 Aug 2003 at 13:23:02.
/directory1/tmp and move 20
photos to that directory. The GIMP is used; a problem, however,
with the current versions of the GIMP (at the time of writing) is
that EXIF information isn't preserved after editing. jhead solves this
problem. Running the command jhead -cmd "gimp &i"
tmp/*.jpg, the GIMP will open the photo, you will edit it;
when the GIMP is closed, jhead will restore the EXIF information.
This process continues until all 20 pictures are done.
I use an Apple laptop to download pictures from my camera. Then, I then transfer the pictures to my GNU/Linux machine where I edit and manage the photos. Something strange happened the last time I downloaded the files to the Mac: the Image Capture program messed up the EXIF timestamp information. The original “DateTimeOriginal” field was changed from the time-the-picture-was-taken to the time-the-picture-was-downloaded, 06 Mar 2005 at around 6:45 am. Therefore, when renaming the files to YYYYmmdd_HHMMSS.jpg, they look like 20050306_064xxx.jpg. This is very bad.
To fix this problem I have to do the following three steps, for each picture:
jhead 20050306_064xxx.jpg The output shows
the real “Date/Time” information. For some reason Image Capture
added a separate DateTimeOriginal field, but didn't erase the correct
one. When calling jhead, the correct one is printed to the screen.
jhead -tsYYYY:mm:dd-HH:MM:SS
20050306_064xxx.jpg, where YYYY:mm:dd-HH:MM:SS is the
correct timestamp.
After doing this for all 166 pictures, jhead -n%Y%m%d_%H%M%S
*.jpg can be ran to correctly rename the files.
The problem is, this will take a long time and it's an extremely
annoying task. Instead, I wrote a GNU Octave script which does this
automatically. It can be viewed
here and download
here.
I have an Olympus Stylus 300 digital camera and have been using MacOS's Image Capture program to download the image files, then transfer them to my GNU/Linux computer(s). In other words, I haven't learned how to download pictures directly to my Linux machine. After the Image Capture's EXIF mangling episode, I'm more motivated to learn how to do this on my GNU/Linux laptop (and this will sever my last tie to proprietary software).
On my Kubuntu laptop I install gPhoto2 and gtkam with the command:
apt-get install gphoto2 gtkam. However, I find that my
camera isn't
supported!
I find a solution from this site:
#mount /dev/sda1 /mnt
#cd /mnt/; ls
dcim trashe~1
#cd dcim; ls
100olymp
#cd 100olymp; ls
< a whole bunch of pictures! >
OK, I now have access to my pictures, can save them to my computer, and be on my way!
Not quite. I want the camera to be automatically mounted. Install
autofs:
apt-get install autofs It appears that the kernel is
properly configures: Starting automounter:loading autofs4 kernel
module.
vim /etc/auto.master
and add the line:
/misc /etc/auto.misc --timeout=30
mkdir /misc
vim /etc/auto.misc
and add the line:
camera -fstype=auto :/dev/sda1
/etc/init.d/autofs stop; /etc/init.d/autofs start
For some reason this isn't working. Will have to look at it later. Restarting autofs seems to work. Connecting camera to USB lights up camera, indicating a good link. But the /misc directory doesn't show the content of the camera. If you can help please contact me at sct at ucsd period edu. For now, I will use the mount command as described above.
UPDATE: An alternative to all the above commands, you can just us KDE! In KDE (version 3.4.3 is what I'm currently using), just plug in the camera to the USB port then the pictures are made available in Konqueror.