How can i avoid the getimage() warning message in php
<p>Recently i worked in project. there i need to a resize a picture and i use the following class. </p>

<pre><code>class SimpleImage 
{  
   var $image;
   var $image_type; 
   function load($filename) 
   {      
      $image_info = getimagesize($filename);
      $this-&gt;image_type = $image_info[2];
      if($this-&gt;image_type == IMAGETYPE_JPEG) 
      {
         $this-&gt;image = imagecreatefromjpeg($filename);
      } 
      elseif( $this-&gt;image_type == IMAGETYPE_GIF ) 
      {
         $this-&gt;image = imagecreatefromgif($filename);
      } 
      elseif( $this-&gt;image_type == IMAGETYPE_PNG ) 
      {
         $this-&gt;image = imagecreatefrompng($filename);
      }
   }
   function save($filename, $image_type=IMAGETYPE_JPEG, $compression=75, $permissions=null) 
   {
      if( $image_type == IMAGETYPE_JPEG ) 
      {
         imagejpeg($this-&gt;image,$filename,$compression);
      } elseif( $image_type == IMAGETYPE_GIF ) 
      {
         imagegif($this-&gt;image,$filename);         
      } elseif( $image_type == IMAGETYPE_PNG ) 
      {
         imagepng($this-&gt;image,$filename);
      }   
      if( $permissions != null) 
      {
         chmod($filename,$permissions);
      }
   }
   function output($image_type=IMAGETYPE_JPEG) 
   {
      if( $image_type == IMAGETYPE_JPEG ) 
      {
         imagejpeg($this-&gt;image);
      } 
      elseif( $image_type == IMAGETYPE_GIF ) 
      {
         imagegif($this-&gt;image);         
      } 
      elseif( $image_type == IMAGETYPE_PNG ) 
      {
         imagepng($this-&gt;image);
      }   
   }
   function getWidth() 
   {
      return imagesx($this-&gt;image);
   }
   function getHeight() 
   {      
      return imagesy($this-&gt;image);
   }
   function resizeToHeight($height) 
   {
      $ratio = $height / $this-&gt;getHeight();
      $width = $this-&gt;getWidth() * $ratio;
      $this-&gt;resize($width,$height);
   }
   function resizeToWidth($width) 
   {
      $ratio = $width / $this-&gt;getWidth();
      $height = $this-&gt;getheight() * $ratio;
      $this-&gt;resize($width,$height);
   }
   function scale($scale) 
   {
      $width = $this-&gt;getWidth() * $scale/100;
      $height = $this-&gt;getheight() * $scale/100; 
      $this-&gt;resize($width,$height);
   }
   function resize($width,$height) 
   {      
      $new_image = imagecreatetruecolor($width, $height);      
      imagecopyresampled($new_image, $this-&gt;image, 0, 0, 0, 0, $width, $height, $this-&gt;getWidth(), $this-&gt;getHeight());
      $this-&gt;image = $new_image;   
   }      
}
</code></pre>

<p>when i use the class it show a warning message like bellow</p>

<blockquote>
  <p>Warning:
  getimagesize(seeker/SeekerPhoto/so.jpg)
  [function.getimagesize]: failed to
  open stream: No such file or directory
  in C:\xampp\htdocs\job\insphoto.php on
  line 11 </p>
  
  <p>Warning: images): supplied argument is
  not a valid Image resource in
  C:\xampp\htdocs\job\insphoto.php on
  line 60 </p>
  
  <p>Warning: imagesy(): supplied argument
  is not a valid Image resource in
  C:\xampp\htdocs\job\insphoto.php on
  line 64 </p>
  
  <p>Warning: imagecopyresampled():
  supplied argument is not a valid Image
  resource in
  C:\xampp\htdocs\job\insphoto.php on
  line 87</p>
</blockquote>

<p>How can i avoid this kind of warning message. Thank you Arif..</p>
