Image galleries are one of the most popular kinds of sites out there on the internet today. Even Apple got into the act by providing a gallery in their .Mac accounts. Now, thanks to DevArticles, you can roll your own with PHP and GD quickly and easily.
Creating An Online Photo Album with PHP and GD (Part 1) starts you off on the road to construct your own image gallery - one that (through GD) can resize your images for thumbnails on the fly, reducing download times and making it easier to see more images at once. The code they highlight creates the thumbnails on the fly when an image is uploaded, and updates the database with the paths for the full image and the thumbnail. They even give you a sample database structure to coordinate with the scripts.
They chose to resize and create the thumbnail on upload, which I think is a very wise choice. It saves a lot of overhead in the long run. Also, they stored the images in the filesystem and not the database. Excellent - remember, let the filesystem be the filesystem, and the database be the database. Binary data in a database is a "no-no".




