a digital photo import script for linux
Published by michael October 30th, 2005 in tech
I’ve been using Ubuntu Linux for 99% of my computer needs since January, and am quite content to not depend upon Windows for anything. One of the nice features that comes with Ubuntu is the ‘gnome-volume-manager’ daemon that auto-mounts usb and firewire devices when they’re connected. I need to start that ($gnome-volume-manager &) once upon booting to xfce since I’m not using gnome, but then it re-starts as long as I save my session.
Since I’m quite particular about how I organize my photos, it was rather time consuming to use the gui wizard to import them, then rename them all with today’s date as a prefix (yymmdd) so they stay in order, and rotate each of them to the correct-side-up orientation. Especially annoying is the need for navigating separately into each directory the camera creates in order to copy out the contents.
I’m all about having directories for my pictures labeled yymmdd_descriptor (ie. 051021_tricktreat) and files inside named similarly yymmdd_5678.jpg (4digit serial number stays intact from the camera). It makes stuff easy to find later.
With help from #bash irc on freenode.net I got the trickier lines of my script below working. You can see by the comments what each line does. Canon embeds orientation data (ie. how you were holding the camera) into the EXIF data, so there’s a nice utility you can apt-get install called ‘jhead‘ (which I can’t quite recall may depend upon exiftran). If you try this you’ll need to modify the path to your camera or memory card. Also if your camera doesn’t prefix everything with img, you’ll need to replace ‘img’ with ‘dsc’ or whatever.



No Responses to “a digital photo import script for linux”
Please Wait
Leave a Reply