[KimDaBa] Import from camera
Robert L Krawitz
rlk at alum.mit.edu
Sun Oct 31 23:41:56 GMT 2004
From: Shawn Willden <shawn-kimdaba at willden.org>
Date: Sat, 30 Oct 2004 09:41:43 -0600
-----BEGIN PGP SIGNED MESSAGE-----
On Friday 29 October 2004 04:51 pm, Robert L Krawitz wrote:
> I'd like to try to figure it out using a card reader rather than the
> camera, if that's possible.
It should be. One complication is that to keep the scripts simple
you'll probably have to make sure you always put the card in the
reader before attaching the reader to the computer. That's because
there aren't any hotplug events for card insertion.
I do that anyway.
When you plug in your CF reader, hotplug will load up the
appropriate driver (almost certainly usb-storage) and then look in
/etc/hotplug/usb for an executable file with the same name. If it
finds one, it will execute it. So that's where you need to hook
in. That script will need to mount the CF file system ('mount -t
vfat /dev/sda1 /mnt/disk' or something similar), figure out which
camera the card is from and then do the copying (and whatever else
you want to do).
SUSE 9.1 already does that with submount. The next thing would be to
add to the script to do the copying.
How to figure out which camera the card is from? Well, you could
use jhead or metacam to analyze the EXIF data (metacam might be
better, as I can't find a way to get jhead to read the "Owner Name"
field, and I like the idea of using that more than the camera
model). You could just place an empty file in the root directory
of each CF card with a name that identifies which camera the card
goes with. You could look at details of file names or file
It looks like the exif command can handle this.
Probably the nicest way is to use the EXIF data, because then you
could swap cards around between cameras at will, and if you
processed each image individually your script would still work just
fine even if the card contained some images from one camera and
some from another.
That's generally a bad idea for other reasons.
Robert Krawitz <rlk at alum.mit.edu>
Tall Clubs International -- http://www.tall.org/ or 1-888-IM-TALL-2
Member of the League for Programming Freedom -- mail lpf at uunet.uu.net
Project lead for Gimp Print -- http://gimp-print.sourceforge.net
"Linux doesn't dictate how I work, I dictate how Linux works."
More information about the Kphotoalbum