Friday, June 24, 2005 8:39 PM
DmitryR
Sample album.ashx handler
I wrote a simple photo album. Admittedly, it doesn’t have half the features many other web photo albums have, but it has one great advantage over them - all it takes is one file, album.ashx. Just drop it into a directory with photos (jpg files) and point your browser to it. That’s it.
It will generate thumbnails (cached in memory, no write disk access is required) for all pictures and subdirectories (yes, it will traverse the directory structure starting with the directory where album.ashx is placed). When clicked on a picture thumbnail it will generate preview page with thumbnails for parent directory, previous and next pictures, and the larger preview pictures. When the preview picture is clicked it will download the real .jpg file. It’s easier to try than to explain.
Preview size and thumbnail size can be modified in the query string by setting thumbnailsize=xxx and/or previewsize=xxx. You only need to do it (place values in the query string) once – the handler will store them in a cookie.
Please give it a try. The attachment contains the source for the handler.