ecco ho trovato una classe per fare thumbnail al volo e funziona da dio ma ha un problema

questo è il codice
Codice PHP:
<?php
class thumbnail
    
{
        var 
$sourceFile// We use this file to create the thumbnail
        
var $originalFilename// We use this to get the extension of the filename
        
var $destinationDirectory// The Directory in question
        
var $destinationDirectoryFilename// The destination filename
        
        
var $createImageFunction '';
        var 
$outputImageFunction '';
        
        function 
generate($sourceFile ""$originalFilename ""$destinationDirectory ""$destinationDirectoryFilename ""$width = -1$height = -1)
        {
      if (!empty(
$sourceFile))
        
$this->sourceFile $sourceFile;
      
      if (!empty(
$originalFilename))
        
$this->originalFilename $originalFilename;
       
      if (!empty(
$destinationDirectory))
        
$this->destinationDirectory $destinationDirectory;
       
      if (!empty(
$destinationDirectoryFilename))
        
$this->destinationDirectoryFilename $destinationDirectoryFilename;
      
      if (!empty(
$width))
        
$this->width $width;
      
      if (!empty(
$height))
        
$this->height $height;

      list(, 
$this->extension) = explode('.'$this->originalFilename);
            
            switch (
$this->extension)
            {
                case 
'gif' :
                    
$createImageFunction 'imagecreatefromgif';
                    
$outputImageFunction 'imagegif';
                  break;
                
                case 
'png' :
                    
$createImageFunction 'imagecreatefrompng';
                    
$outputImageFunction 'imagepng';
                  break;
                
                case 
'bmp' :
                    
$createImageFunction 'imagecreatefromwbmp';
                    
$outputImageFunction 'image2wbmp';
                  break;
                
                case 
'jpg': case 'jpeg':
                    
$createImageFunction 'imagecreatefromjpeg';
                    
$outputImageFunction 'imagejpeg';
                  break;
                
                default : 
                    exit(
"Sorry: The format '{$this->extension}' is unsuported");
                  break;
            }
            
            
$this->img  $createImageFunction($this->sourceFile);
            
            list(
$this->org_width$this->org_height) = getimagesize($this->sourceFile);
            
            if (
$this->height == -1)
            {
                
$this->height round($this->org_height $this->width $this->org_width);
            }
            
            if (
$this->width == -1)
            {
                
$this->width round($this->org_width $this->height $this->org_height);
            }     
            
            
$this->xoffset 0;
            
$this->yoffset 0;
            
            
$this->img_new imagecreatetruecolor($this->width$this->height);    
            
            if (
$this->img_new)
            {
                
imagecopyresampled($this->img_new$this->img00$this->xoffset$this->yoffset$this->width$this->height$this->org_width$this->org_height);
                
                list(
$this->newFilename) = explode('.'$this->destinationDirectoryFilename);
                
                
$this->fullDestination = ($this->destinationDirectory.'/'.$this->newFilename.'.'.$this->extension);
                
                
$outputImageFunction($this->img_new$this->fullDestination);
            }
            else
            {
                
$this->failed true;
            }
            
            if (
$this->failed == false)
            {
                return 
$this->fullDestination;
            }
        }
    }
?>
l'ho presa da html.it e non capisco perchè al momento di fare la thumb di una bitmap sputi fuori questi errori:

codice:
Warning: imagecreatefromwbmp() [function.imagecreatefromwbmp]: '/tmp/phpcZp4zI' is not a valid WBMP file in /newhome/puglfabr/public_html/meta/thumb/thumbnail.class.php on line 86

Warning: imagecopyresampled(): supplied argument is not a valid Image resource in /newhome/puglfabr/public_html/meta/thumb/thumbnail.class.php on line 107
le righe incriminate sono queste: VVoVe:

codice:
$this->img  = $createImageFunction($this->sourceFile); <= riga 86
imagecopyresampled($this->img_new, $this->img, 0, 0, $this->xoffset, $this->yoffset, $this->width, $this->height, $this->org_width, $this->org_height); <= riga 107
vi chiedo aiuto....