dt - Disk Thumbnails

web page output

dt (Disk Thumbnails) makes HTML pages for, and extracts EXIF thumbnails from, a collection of images from a digital camera before you burn the collection to CD/DVD. It assumes you've put all the files inside one directory arranged the way you want them on the final CD/DVD.

All output goes into the directory which becomes thumb_home. Most EXIF thumbnails are about 5K, the thumbs dir on a DVD with 2400 images needs about 15 megs free.

Mostly you run this with "dt <start_dir>" and that's where everything happens. It creates thumb_home as 'thumbs' inside that. But if you start it as: "dt <start_dir> <thumb_home>" then start_dir can be a CD/DVD you've already burned and thumb_home can be somewhere on your hard drive. start_dir would be the mount point for the removable disk, like /cdrom or /media/cdrom

This lets you build collections of thumbnails of images on CD/DVDs on your hard drive, which of course can be periodically burned to more CD/DVDs as backup. A simple HTML page can link to these collections. The idea being that, as a photographer, you can have thumbnails of all your pictures in one place without having to go find the CD/DVDs and stick them in. And it they don't take much space.

My choices for fields in the image tooltips were: image date/time, filename, latitude and longitude. You can change that (with a little work). If you're not familiar with EXIF data look it up, better yet run exiftool or exiftags on a couple of your images to see what fields are available. There are potentially 0xFFFF (65535 decimal) fields available, different camera manufacturers implement different ones.

no_thumb.jpg is a dummy image used in cases where the image having the thumbnail extracted doesn't have any EXIF thumbnail inside. Most modified images don't have thumbnails, only images that come direct from a camera. Copy it someplace permanent and set the path to it inside dt.c (at the end of pull_thumb()).

There are compiler warnings, most are in libexif. There's one I'm responsible for involving arg 4 of qsort() but it works and I had a hard enough time getting qsort to sort structs that I'm not going to mess with it. Probably needs a cast to void * or something.

I don't know much about libexif versions, but I used libexif-0.6.21 because that's what was in the ports collection for OpenBSD 5.2. You shouldn't need the JPEG libraries, I think libexif handles that.

I don't use tables or anything to arrange the thumbnails on the HTML pages, I just spit them out and let them wrap to fit the browser window. There's a known problem with making CSS tooltips the way I did in that some may extend off the screen on the right side. If you really need to read one in particular just resize the web browser window temporarily so the thumbnails wrap differently.

When you click on a thumbnail in the master picure index, that brings up the index for that directory. CSS tooltips are implemented at that level. Clicking on one of those thumbnails brings up the original image if the indexes are on the same disk with the images. It would have been nice maybe from an archival standpoint to have the disk volume label appear in the master index, but I didn't try to do that. Not all my pictures have GPS data, only if I'd been outdoors long enough for the GPS to get a fix on several satellites. I was planning to use elevations from the GPS too but too many are very wrong.

You can of course put other things in the leftover space on the CD/DVD but I've found it's best to not put them into the directory you plan to burn from until after you've made the thumbnails. I put in a copy of my source code for this, and a copy of thumbs from a DVD earlier in the series and those directories got cloned into thumbs along with everything else. So keep the cache area just images until there's almost enough to burn, then make thumbs, then fill up the rest of the space. Gotta get your 20 cents' worth out of that blank DVD after all. :) Good place to backup your bookmarks, address book, password list, all the code you've written since the last DVD.

And since we're in non-GUI mode, here's the command I burned the DVD with:
    growisofs -speed=1 -Z /dev/rcd0c -R -J -v /usr/ppc_650/dvd2

If there's interest I might make a Windows version but this is mostly intended for unix (OpenBSD). There's no GUI at all. I can't afford a Mac so I don't know much about them, I've never even seen OS-X.

The 4/17/2014 version fixes a bug, adds autorun.inf and winopen.exe to the root of the CD/DVD to make the disk autorun under MS Windows. You'll need to change UTIL_DIR near the top to point to where you're going to keep these files. Other than that you can copy dt to somewhere in your path like /usr/local/bin and be able to run it from anywhere.

the tarball

Alan Corey, ab1jx 4/17/2014

7/1/2014 There is a minor bug in that autorun.inf and winopen.exe end up inside the thumbs directory instead of at the DVD root inside the master directory structure. This only affects Windows users to the extent that the disk won't autorun when you stick it in, you have to browse the disk in My Computer or something and double-click on index.html or pindex.html inside the thumbs directory. Move them where they should be before you burn the disk.

I think the only dependency of this is that you need libexif installed. It doesn't know anything about the thumbnails themselves, it only extracts them from the EXIF data as a BLOB. The HTML written assumes the thumbnails are 160 wide and 120 high so if your camera(s) make a different size change this in dt.c. It should probably be a #define but isn't. The program could be made intelligent enough to detect the size but that would add the JPEG library as another dependency (and slow it down). I don't buy cameras that often. :(

AB1JX / calcs