This is a text description of photal16.gif.
The main procedure for the Photo Album application is view_album. This procedure calls the following procedures: print_page_header, view_entry, deliver_media, view_upload_form, and print_page_trailer.
The print_page_header procedure displays the common page header for each page.
The view_entry procedure calls the following procedures: print_page_header, deliver_media, and print_page_trailer.
The deliver_media procedure retrieves the image from the database, either the thumbnail or the full-sized image, sets the mime type using the owa_util.mime_header package, and delivers the image to the browser using the wpg_docload.download_file package. Both packages are part of the PL/SQL Web Toolkit.
The view_upload_form procedure calls the following procedures: print_page_header, print_upload_form, and the print_page_trailer.
The print_upload_form procedure calls the print_header procedure to display a static message and then calls the insert_new_photo procedure.
The insert_new_photo procedure inserts the new photo into the photo album. Before inserting the new image, it performs error checks to make sure the image file is not null or is of zero length. After passing the error checks, it calls the ordimage_init procedure to initialize the image column and the thumb column, then fetches the full-sized image and the thumbnail image objects for update, loads the image into the image column and sets its properties, if the image format is not supported, it calls the get_preferred_format procedure. If the image file format is supported by interMedia, it creates a thumbnail image and stores it in the database along with the full-sized image. Then it deletes the contents of the photos_upload table, refreshes the browser by calling the print_page_header, the print_heading procedure to display a message, and the print_page_trailer procedure.
The get_preferred_format procedure returns the preferred image file format based on the number of bits of color in the image. It converts the image to a GIF image file format for images with less than 9 bits of color or to a JPEG image file format if the image has more than 8 bits of color.
The print_page_trailer procedure is controlled by a Boolean operator, that when true calls the print_link procedure, otherwise when false, no text link displays.
The print_link procedure displays the text "Return to photo album" as a link, which when selected calls the view_album procedure.