Digital Photo Notes

Steve Thompson
Some notes on using a digital camera with a digital computer.

back


Contents


20030904: Edit and Manage Digital Photos With GQview, jhead, and The GIMP

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:

  1. Get snapped and collected in my camera.
  2. Get transfered to my computer.
  3. Get edited.
  4. Get published on web where they reside for the rest of their life. Using zoph the photos can be assigned various attributes. If you need the photos printed, Shutterfly provides a good service.

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.

  1. Place the fresh photos in some directory, say /directory1.
  2. View the photos in the directory with GQview. Delete bad/unwanted photos.
  3. At this point /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.
  4. This week, let's edit 20 pictures. Make a subdirectory /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.
  5. Next week, 20 more! Got to step 4.

top


20050314: Fixing EXIF Information with GNU Octave

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:

  1. 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.
  2. Copy the correct “Date/Time” information.
  3. Run 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.

top


20050417: Downloading Pictures to GNU/Linux

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:

  1. Connect camera to USB.
  2. (as root) #mount /dev/sda1 /mnt
  3. #cd /mnt/; ls
    dcim trashe~1
  4. #cd dcim; ls
    100olymp
  5. #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.

  1. vim /etc/auto.master and add the line: /misc /etc/auto.misc --timeout=30
  2. Now, add directory: mkdir /misc
  3. vim /etc/auto.misc and add the line: camera -fstype=auto :/dev/sda1
  4. Restart autofs: /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.

top


Valid HTML