We’ve created a simple macro that creates a photo album interface for pictures. Our macro generates thumbnails for a set of pictures and shows the thumbnails on the same page. Each thumbnail is a link to a slideshow! “web-sized” images are used in the slideshow, and a link to the full-sized version is also provided. By “web-sized” we mean 800px, but you can define that in the parameters, please see Usage.
You can download MakeAlbum.jar here.
Goodbye config file! Hello plug and play!
To use make-album just pop the jar into your application’s WEB-INF/lib directory and restart the server. Make a new snip using this following tag:
Where albumDirName is a directory in your application’s images directory. Default thumbnail size is 240px and default web-size is 800px. if you’d like to change them, you can specify those as parameters like so:
Where thumb_size and web_size are integers.
Also, if you’re running this on linux, unix, etc. you will need to modify your run script to include this java flag:
Please see Notes for more.
Next on the list is to make a very user friendly way to enter captions….
Fix! Some of you may have noticed that some thumbnails/websized images ended up being of a psychedelic nature. if you use the new jar, you will no longer notice that effect as the method for resizing pictures has been changed.
Source and a Makefile are included in MakeAlbum.jar.
As promised, more on the headless issue: On Linux (or *nix), please run java with the -Djava.awt.headless=true option. (You can add this to run.sh.) If this system property is not set, AWT will try to connect to an X Windows display, which usually won’t work since SnipSnap is a server. If you’re on Linux, and you see “make-album: none” in red when you use the make-album macro, this should solve your problem.