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.
Download
You can download MakeAlbum.jar here.
Usage
version-a-little-more-than-before:
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:
{make-album:albumDirName}
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:
{make-album:albumDirName|thumb_size|web_size}
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:
java -Djava.awt.headless=true
Please see Notes for more.
Future plans
Next on the list is to make a very user friendly way to enter captions….
Authors
Notes
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.
Stay tuned!
I can’t make it work!!! :(
I put some images under my <snip-snap application path>/images/fun path and I cannot see a damn thing the only thing I get is:
Please wait while make-album generates thumbnails. This may take a while (2-5 seconds per picture). This message will only be displayed once.done.
Please wait while make-album generates web images. This may take a while (2-5 seconds per picture). This message will only be displayed once.done.
Just a few more seconds to generate the HTML
Can u help please?
Oded
hi oded! sorry it’s not working.
is this a public site? if so, could you post the link to your snip? it’d be useful to see the HTML that album generates.
also, which OS is this? if linux or *nix, check that the permissions in your
images/fun
directory are set so that snipsnap – specifically, the user running snipsnap – can write to it.