A Simple Image Browser

I have around 25-30,000 photos, I’m not totally sure. To keep things simple they are organized into hierarchies using the file system. Grouped depending on the subject matter. That is either the object the photo, the location it was taken, or the event I was attending.

This organization makes it easy for me to find the folder where the photo I need is most likely to be located. The downside is that having located the folder, I may need to browse several hundred photos to find the one that I want.

Not content with just having my photos on my laptop, I want to be able to access them from anywhere in the world as well, even when I don’t have my computer with me. I find myself in a situation where I want to show one or more of my photos to somebody and figure all I should need is a web browser to do it.

In 2007 I started looking for a simple piece of browser software that I could use. I imagined I would tell it where the top folder of the hierarchy was and the software would handle everything else. It seemed like a simple idea that somebody must have built already. With its very simple requirements it could by no means be “rocket science”, or so I thought.

I searched around and found software that could display hierarchies of files, display thumbnails and allowing you to enlarge each photo. Each package I looked at had the same flaw. For the software to work I needed to use their software to upload my photos into their “photo management” system. Each wanted to setup Databases to store information and other details. Even worse, you had to re-create your hierarchy using their software folder by folder.

I didn’t want to upload my files using some piece of software and I didn’t want to set up a MySQL Database just for my photos. On my local hard drive I know where the root of my photo hierarchy is. On my web server I knew where I had my photos stored. If I wanted to add more photos I could just FTP them to the server. I already had a process for keeping my local and server hierarchies in sync that did just that. Don’t get me wrong, I’m not against MySQL Databases, I program them every day. For such a simple lightweight implementation I felt they were a bad fit.

Frustrated as I was, one weekend in 2008 I set about writing a simple image browser that was totally self contained in one PHP file. My goal was for it to be lightweight. The user would install it at the root of a hierarchy of images. The user interface would be a list of sub-folders on the left and thumbnails on the right. A thumbnail clicked on would result in a larger version being displayed. A folder clicked on would drill down a level. There would be no databases, and you could upload the files however you wanted.

That weekend I built it. It uses the thumbnails from the EXIF information if they exist, otherwise it creates new thumbnails and caches them for later use. If you wanted a new folder displayed, you create one in the file system, add your files, hit refresh in the browser and they are displayed. No messing around with Databases, no separate uploading, configuration or administration headaches. The structure is under your control using a tool everyone knows how to use, a file browser.

From 2008 until now I have used it to peruse images in my collection. It’s nothing fancy, you can’t use it to search for images. Your files need to organized in a way that makes finding the right folder easy for you.

This weekend I put the source code with a royalty free license to do with it whatever anybody wants to up on GitHub. If you have a similar need to quickly dig through your image collection using a web browser, it may just be the simple solution that you are looking for. Maybe other people will enhance it too.


If you need it you can find it here: image-browser.


Now read this

Experiment #4 - TaskRabbit

So I had tickets to a concert in Oakland at the Fox, for which I was now familiar with the layout having seen the Pet Shop Boys there in December and Kraftwerk the previous Sunday. I knew exactly where I wanted to stand and if I didn’t... Continue →