Mariusz Slonina

Contact   Site Login

Linux Photo Managment

I take a lot of photos. And one day I faced the problem of effcient managing them. I tried GQView, Digikam and Picasa (and many other apps, both java and php). And still - there are no apps for photo managing in Linux that satisfy me. However, for the simple managing I did what follows below.

I have a MyBook external disk and I created a huge (100 GB) partition only for photos taken by me, and taken with my Nikon D40.

Then, I setuped Picasa (to watch only for photos in that partiton) because, it seems to be currently the best photo manager, althougth runs in Wine. I know, Digikam is also great app, however, I don't want my photos to be dependent on Desktop Environment, such KDE.

The problem is when your camera photo counter resets (in Nikon after 10,000 pics) and you have to deal with different photos with the same DSC number. However, there are some nice tools available;)

Since, I'm a Command-Line Man, first of all I looked for CLi tools. For managing photos, exiv2 tool is available in, I think, almost every Linux distro.

To deal with batch rename of photos, I created small bash script:

#!/bin/bash
EXT="DSC*.JPG"
BEXT=".JPG"
for i in $EXT; do
basename $i $BEXT > tempname
number=$(cut -d'_' -f2 tempname)
exiv2 rename -r ND_%Y%m%d_%H%M%S_$number $i
done
rm -rf tempname

Exiv2 will rename your photos according to pattern, in my example, the photo wil be renamed to sth like ND_20080302_181618_0781.JPG.

Most of photo managment tutorials says, that it is enough to rename photos only according to its taken date. However, in shooting mode of your camera, the taken date will be the same for 2 - 3 photos (ND40 can take photos with 2.5 frames per second), so you will lose some of them... The solution is to check also photo DSC number and append it to name.

How can I use the script?

I import photos from D40 to MyBook photo partition created above, then I batch rename with my script and finally run Picasa to watch them, tag them, sync to web etc.

Feel free and enjoy!

Now, assuming the time goes by and never goes backwards, every photo you take with your camera will have unique name!

Still, I wait for great Linux Photo Managment App, I thought, that with Python + QT and Sqlite it will be posible to create such app, however, I don't have time now. Maybe some day...

2 comments

 
thdox — April 13, 2009

Your script can be done in a one-line command, that I personnaly use, expect that I do not add time like you, for me date is enough. Here it is:

exiftool '-FileName<CreateDate' -d ND_%Y%m%d_%H%M%S_%%.4f.%%e DSC*.JPG

root — April 15, 2009

I didn't know about exiftool, I must check it:)

Add your comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <em> <strong> <cite>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.

GoldenLine

See my photos

flickr  picasa