Creating an ASP thumbnail gallery

This is a downloadable example showing how a directory of photographs in jpeg format can be displayed using the csImageFile component and ASP. The images shown below have been dynamically resized using csImageFile. Clicking on each image will link to the full size JPG image. The gallery can be navigated by using the links to the first, last, next and previous pages, or by selecting the page number using the selection box.

This is a more advanced example than the thumbnails example. It lists all the images in a directory and shows a specific number on each page, with navigation links to other pages. The directory path must be set in the code, as well as the number of images to show on each page and the size of each resized image.

The example code can be downloaded but you must also have the trial csImageFile component installed for it to run. Here are the files.

Download the trial csImageFile component - csift.zip (4.5 MB)

Download the sample scripts - gallerydemo.zip (43 KB)

The demo keeps the HTML formatting to a minimum to make it easier to understand the scripting. The working example shown on this page uses CSS to position the images. It could also have been done using tables.

This example also shows how some editing can be performed on the images as well as the resize. We have placed a small logo on each thumbnail image. csImageFile has options to include full or partial transparency when images are merged in this way.

The downloadable code includes a readme.pdf file which explains how the demo works but there is also an online explanation of some of the code.

Cookies

This site uses cookies for functionality, traffic analysis and for targeted advertising. Click the Accept button to accept our Cookie Policy. The Cookie Policy page offers configuration for a reduced set of cookies for this site.