Branimir's Blog Archive

branimir.com : Branimir's Blog

Thursday, June 17, 2004

Enterprise Photo Gallery (EPG)

After having spent hours looking for decent photo gallery software I decided that it might be a better idea to spend a few minutes writing my own. Here you can see it in action: Zadar Gallery, Munich Gallery. Highlights: Of course it is Free Software, you can use it under terms of GPL. Here's the source code (it requires OpenACS 4.0 or higher and ImageMagick):
cd [ns_info pageroot]/[ns_conn url]
set list [glob *.jpg *.JPG *.jpeg *.JPEG \
  *.png *.PNG *.gif *.GIF]
multirow create pics name
file mkdir thumbs
foreach pic $list {
  if {![file exists thumbs/$pic] || \
    [file mtime thumbs/$pic] < [file mtime $pic]} {
     exec /usr/bin/convert -interlace NONE \
          -geometry 300x300 $pic thumbs/$pic
  }
    multirow append pics $pic
}

Update (1 September 2004): A friend pointed out that I forgot to publish the HTML template - here it is:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title>Photo Gallery</title></head><body>
<multiple name="pics">
 <a href="@pics.name@"><img border=0
    src="thumbs/@pics.name@" alt="thumbnail"></a>
</multiple>
</body>


Posted by Branimir Dolicki at 20:23

# - G - Add comment

» Branimir's Blog
» Archive

You may request notification for Branimir's Blog.

bdolicki@branimir.com