Your final program is to write a script that will make thumbnails from a directory full of pictures. You may write this in PHP or Perl. You may store the thumbnails in either a database or in files. Your program should work with JPG files. This script it meant to pre-process a directory full of pictures. It is NOT meant to be run on the fly after a request is made. It runs from the command line, not from Apache. YOU CANNOT GET MORE THAT FOUR POINTS 1 point -- Program can make a thumbnail 1 point -- Program can do a whole directory 1 point -- Program stores the thumbnails in a database table 1 point -- The program is written in PHP 1 point -- The program is written in Perl 1 point -- Program turned in by Monday of finals week Below are some notes that might be useful... -------------------------------------------------------------------------------------- The function 'glob' exists in both PHP and Perl. Given a file pattern "*.jpg" it can produce a list of filenames in current directory. From the command line, something like the following command will make a thumbnail. djpeg filename.jpg | pnmscale ARGS | cjpeg > thumnaildir/.filename.jpg Below is a bunch of PHP image directives that might prove useful.... $srcimg=ImageCreateFromPNG($source_file_name) or die("Problem In opening Source Image"); ImageCopyResized($destimg, $srcimg, $destX, $destY, $srcX, $srcY, $destWidth, $destHeight, $srcWidth ,$srcHeight); An important function that does the work for us. This function copies a rectangular portion from an opened image. This function takes in a row of parameters. Lets see what are they. Destination Image Handle/Identifier Source Image Handle/Identifier Destination Image X value Destination Image Y value Source Image X value Source Image Y value Destination Image width Destination Image Height Source Image width Source Image Height We can omit the destination x,y and source x,y values by supplying 0. You might also notice these functions used in the argument. $width = ImageSX($img) - Returns the Width of the image $height = ImageSY($img)- returns the Height of the image. Example