I was designing a photo album viewer for a Jalbum user and ended up with iAlbum. It’s basically just a PHP script that crawls through a bunch of images in an album-oriented directory structure, generates thumbnails, and presents the images using a lightbox.
Originally, the script generated one thumbnail per image. The result loaded quite slowly, and the thumbnails appeared out of order in the browser. After I switched to using CSS sprites, the thumbnails loaded much faster and were displayed all at the same time. The first time an album is viewed, a strip of thumbnails is generated for it and cached. After that, the cached version is sent to the browser (there’s an option to regenerate the thumbnail should the album change). I was worried that clustering all the thumbnails into one long strip would be too much for PHP to handle, but it turned out to be pretty fast even for an album with a couple of hundred images.
During the project, I encountered Lytebox, an excellent lightbox implementation that does not depend on any of the bulky libraries the way the other implementations did. After minifying and gzipping, the script weighed in at only 5.7kb. I left the CSS alone for an additional 5.7kb, but it would have been about 1kb gzipped.
