[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] photo album in chicken

From: Peter Bex
Subject: Re: [Chicken-users] photo album in chicken
Date: Sun, 30 Apr 2006 13:50:16 +0200
User-agent: Mutt/

On Sat, Apr 29, 2006 at 09:40:55PM +0100, Ashish Shrestha wrote:
> Hi!
> Chicken scripts to generate a HTML gallery. Something I wrote to learn
> scheme so is less scheme than most would like to see. Yes I know I
> have a lot to learn so would love to get feedback on the code.

I must say your code looks great.  I also wrote an image gallery like
this, but mine is messier (mostly because I output strings, not SXML).
You can have a look at mine by fetching the 'phoghorn' egg.

> The album uses Lightbox JS and sample albums are at
> Specially the new albums.

IMHO using javascript for this is overkill.  Of course this is a matter
of preference, I think.

> Would love to hear about the code. What is the correct way to handle
> errors and an issue with memory. I run out of memory and the script
> hangs when I am working with large (5 mega pix or higher) images.

I think you're missing a call to imlib:destroy to free the memory used
by an image.  The imlib2 egg is a pretty direct set of bindings to the
C library and does not hook to the garbage collector for cleaning up
memory automatically.

Also, since you only accept JPEG images, I can recommend changing your
program to use the epeg egg instead of the imlib2 egg.  epeg is just like
imlib, only specialised for JPEG images.  It was written by Rasterman
from the Enlightenment project precisely for this purpose; scaling
many photos to thumbnails for galleries.  Because it less general-purpose
it can be much faster.  I think it's about twice as fast as imlib2.

"The process of preparing programs for a digital computer
 is especially attractive, not only because it can be economically
 and scientifically rewarding, but also because it can be an aesthetic
 experience much like composing poetry or music."
                                                        -- Donald Knuth

Attachment: pgp1oX9yCvMjx.pgp
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]