Project 3 - Picture gallery
the blog was missing an image gallery as well as a good programmer "Old-style" I am screwed all the packages and I am pre-programmed in my own way ..
So .. to manage an image gallery functions to be managed are basically 3 .. entry, viewing and deleting images.
course also serves as a web space to upload files.
Like any project that the Internet is the starting point is the layout of the web page that will contain the final gallery. In my case I chose to create a table of 36 cells, in which the inner cells 16, together, contain the larger picture, while the remaining 20 various miniatures.
This choice dictates the size of stored images and related mininature, respectively 640x480 and 160x120 the first points of the second.
So the best thing to do is save the images directly on the server with these dimensions. Let's go step by step
:
The input function is handled by a simple form that identifies the image to load and write a text that will be the photo captions.
The form then passes the data to a php page that takes care of saving data on the server.
Saving takes place in three phases: first phase
: you save the image size of 640x480 points that will be a larger image.
in the case of photos you keep the vertical height of 480 points and you resize the width
second step: you save a thumbnail in size 160x120 points.
third stage: you save a text file that contains the caption of the photo.
the files is responsible for a serial number that is used to sort the files in chronological order of release.
The heart of the gallery is the display page, which performs many functions:
Being able to display only 20 images per page, you must determine which page is, view their images and manage the exchange page.
must dynamically create the table containing the thumbnails, creating for each cell links related to illumination, the caption, and commands to view a larger image.
provvederea must create the empty cells of the table, if there were not enough pictures to fill it.
All these functions are handled quite easily through php, except for the display function of the enlarged image, managed through a javascript.
As for phase cancellation, the only attention is de place in the recreation index numbers to eliminate duplicate numbers in any holes and later additions.
simply, after you delete the files and have made the index number, you rename the files later, climbing up on the index by one.
The end result is a tunnel which can be accessed in the links section!
0 comments:
Post a Comment