Web Programming Lab 5: Image Gallery

Moving into the fifth lab of my web programming course, we received a couple of more interesting projects to accomplish. The first of which was to break down a log file to count the hits base directories were receiving. To take a look at the output of the program was, look here. Also, we expanded our web pages that we have been working on to contain a gallery. I used the php GD class to generate thumbs from images that are passed to a simple function I created. When the image path is passed to the function, it begins by checking the directory to see if a thumb of the image has been created yet. If it has, it simply returns the path to the thumb. If the image does no have a thumb, it generates them to meet some criteria housed in the method. To take a look at the new gallery page, look here.

  1. You could have accomplished the log parser quicker with regexp, but still a solid implementation. Good catching of edge conditions.

    The use of GD was good, however the implementation is a little clunky. Imagine the first load, the user will have to sit through each thumbnail creation before loading. This may be ok for 10 pics, but what happens as it scales up? On that note… hardcoding each image into the script also lacks flexibility. Reading a directory and finding all images in it and using that would allow you to drop an image in a folder and have it dynamically add to the gallery. This way works, but comes with substantial maintenance.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: