18th Jan 2008 by Mark Turansky

HOW TO: Download & sort pictures from your camera using Python

Filed under Filed under HOW TO, Python

I’ve got tens of thousands of photos. When I last checked, the size on disk was over 25gb. And why not? Film is free!

How do I keep track of them all?

First, there’s Picasa from Google. It’s awesome. It’s the iTunes of photos.

Second, there’s a little Python script I called “DownloadPhotosFromCameraAndSort.py” (It’s .txt on the server, rename to .py if you download it).

If you couldn’t tell, I like meaningful names for my scripts. Likewise for my Java classes, components, projects, etc. Good code communicates it’s purpose clearly without too much human parsing.

The script does the following:

  1. Find my camera
  2. Download all pictures/movies to 1 or more destinations
  3. Confirm the download before deleting the picture from the camera
  4. Sort the pictures into a dated subdirectory based on the individual picture’s last modified time

The dated directories give me a running chronology of my life and the lives of my wife and daughter. It’s not a fancy archival system, but it’s simple and easy for me. It may work for you, too.

The archive looks like this:


photosdir.jpg

What's next? CommentsLeave a comment Digg it Save This Page

One Response to “HOW TO: Download & sort pictures from your camera using Python”

  1. Jason McDonald Says:

    This is great - I was about to write one of these to compliment my existing application that makes finding and removing duplicate images easier. Since you did it I don’t have to.

    Also, your altruism in sharing this with the world has inspired me to release mine as well:
    http://www.mcdonaldland.info/2008/01/21/images/

    Look out Picassa…

Leave a Reply