Album Creator 1.0a
- Introduction
- Programming
- Tutorial
- Example
- Conclusion
1. Introduction
Being on a ship, working 12 hours a day, and trying to "look" busy are all fairly common while on deployment in the Navy.
In an attempt to break this cycle I created a program to solve a small problem I had with our website.
The website had a Photo Album that had to be updated once in a while with new pictures.
Everyone wanted new pictures on it, and I didn't want to be the one stuck picking them out.
To solve this, I created a utility that anyone could use to update the pictures on our Photo Album.
The goal was to create thumbnails in the Photo Album that link to the larger versions of the image.
It is pretty common for websites to have this, and I am sure there are many ways to do this using dream weaver or front page, but I wanted to make my own utility that anyone could use.
First, there are a few things you should know:
- The website only needed one album.
- It needed to be updated by non technical personnel.
- technical personnel should be able to change the layout of the web-page so when the non technical personnel created the album it would fit in with the website.
- It could not have any server side programming.
- I had a lot of time on my hands sitting in front of a server 12 hours a day.
If you would like to try out the program click here and open the file in java web start.
2. Programming
The program I came up was simple.
Take a folder of images, re-size the images for use on the web, create thumbnails, and use a template to make a web-page for navigation through the images.
The programming language I used was Java, and the IDE I used was Netbeans.
It uses three threads to create the album. One for the images, one for the thumbnails, and one for the web-page.
It took me about a week to make, with the oldest file dating April, 2 2007.
To generate the HTML for the web-page I used velocity templates.
Using templates allowed me to setup the layout without worrying about the actual images.
Download the source.
3. Tutorial
Here is a short tutorial on how to use the program.
First open the program select a folder containing pictures, and select a folder to save the album in.
Next open a template file for the album.
There is an example template file that I made.
## This is an example template file that can be used with my ImageConverter
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/xhtml1-strict.dtd">
<html>
<head>
<title>My Picture Album</title>
</head>
<body>
<h1>My Picture Album</h1>
<hr/>
<table cellpadding="0" cellspacing="0" border="1" summary="Pictures">
#set($i = 0)
#set($total = 0)
#set($row = 0)
#foreach( $name in $list )
#if($row == 0) <tr> #end
<td>
<a href="images/$name"><img alt="$name" src="thumbs/$name"/></a><br />
$row - $name
</td>
#if($row == 5) </tr> #end
#set($i = $i + 1)
#set($total = ($i / $list.size()) * 100)
#set($row = $row + 1)
#if($row > 5) #set($row = 0) #end
$ConverterProperties.setWebProgress($total)
#end
#foreach($num in [$row..5])
<td> </td>
#end
</tr>
</table>
<hr />
</body>
As you can see there is a variable and a method that is created by the program.
$list is a list of filenames for the images.
$ConverterProperties.setWebProgress($total) updates the progress in the program.
There is also $folder, which is the name of the folder the pictures are in.
Most of the time the progress goes from 0% to 100% because it only has to make one webpage.
The progress for converting the images is much slower.
You should have something that looks like this.
Next you can change the settings for the large image size and the thumbnail size.
Adjust was going to be an option to smartly rescale an image so it didn't end up looking stretched.
I didn't find a need for it with pictures from a camera so I never programmed that part in.
HTML Image Template was going to be a template used when displaying each image in the album.
Once you click on convert the program will begin to build your album in the save folder.
Once finished you can view the album and change it however you like.
4. Example

Check out the album I made: Babies and the Navy
5. Conclusion
If I were to remake this program, I would use the new Application Programming Framework for swing.
I have messed around with it a few times and I think this would be the perfect program for it.
I would also add a few features.
If it could make and entire tree of albums it would be much more useful.
I would also add a template for each individual image to be in its own page.