I thought that I'd share this bit of code from my Joomla 2.5.x component (which allows administrators to upload images, set categories, comments etc...) - what it does is to make a thumbnail of the image, returning true if success and false if fail. It *should* also handle alpha blending for PNGs and transparency with GIFs, but finding testers out in the wild is quite difficult. So, please try the code (even though it's a Joomla thing, it should work fine elsewhere with the relevant modificaitons) and feel free to comment or to tell me if it falls over.
PHP Code:
/**
 * This accepts two parameters, the file path to the image that you want
 * to create a thumbnail of ($file) and the directory path and file name
 * where you want to put the thumbnail ($directory).
 * For the purposes of this module, the directory path to the images are:
 * ../images/mypictures/example.jpg
 * and the place to put the thumbnail is:
 * ../images/mypicturesthums/thumb_example.jpg
 * Returns true if everything has worked out okay, false if there has been
 * a problem when calling the function
 * @param string $file
 * @param string $directory
 **/
public function createThumb$file=''$directory '' ) {
    
// Booleans used to set the type of images that we'll deal with later
    // (all false by default):
    
$jpeg false$png $jpeg$gif $jpeg;
    
// Gets the type of image from the array:
    
$type $this->imgData['exts'];
    
// Checks for each case to ensure that the relevant filetype is called:
    
switch($type) {
        case 
'gif':
        
$img imagecreatefromgif($file);
        
// Checks for transparency:
        
$transparentIndex imagecolortransparent($img); 
        if(
$transparentIndex!=(-1)) {
            
$transparentCol imagecolorsforindex($img$transparentIndex);
        }
        
$gif true;
        break;
        case 
'jpeg':
        case 
'jpg':     
            
$img imagecreatefromjpeg($file);
            
$jpeg true;
        break; 
        case 
'png'
            
$img imagecreatefrompng($file);
            
// Checks for alpha channel:
            
imagealphablending($imgtrue); 
            
imagesavealpha($imgtrue); 
            
$png true;
        break; 
        default: 
            return 
false;
        break;
    }
    
// This should be the same as saying $newX = imagesx($img)/8, but might
    // be a bit quicker:
    
$newX imagesx($img) >> 3;
    
$newY imagesy($img) >> 3;
    
// Creates instance of thumbnail at 1/8 the size, and scales the parent image appropriately:
    
$small imagecreatetruecolor($newX$newY);
    
imagecopyresampled($small$img0000$newX$newYimagesx($img),imagesy($img));
    
// Saves new image according to type:
    
if($jpeg) {
        
imagejpeg($small$directory100);
    } else if (
$gif) {
        
imagegif($small$directory100);
    } else if (
$png) {
        
imagepng($small$directory100);
    } else {
        
// If no boolean is set then something has gone wrong:
        
return false;
    }
    
// Releases resources:
    
imagedestroy($img);
    
imagedestroy($small);
    
// You success:
    
return true;

I call this function like this:
PHP Code:
     $thumbCreate $this->createThumb($imagePath$destinationPath);
     if(
$thumbCreate) {
          echo 
'Thumb created successfully<br />';
     } else {
          echo 
'Thumb not created. Please contact the developer<br />';
     } 
I know what you're thinking... that the curly braces should go on the proceeding line - I typically do this for Java, C and C++, but it's the convention where I work so sorry about that...

Regards,

Shaun.