title: How to image Resize using imagecreatetruecolor function
body: <p>I am trying to uplod full width and full height image, this is script 
  but don't know where's mistake ?</p>
  
  <p>I want upload full width and height (<strong>ORIGINAL WIDTH AND HEIGHT</strong>) image..
  check below code once. this code return 600 by 400 image but i want original width and height image.</p>
  
  <pre><code>&lt;?php
  function create_image($file) {
      // Content type
      header('Content-Type: image/jpeg');
      header('Content-Type: text/html');
  
      // Get new sizes
      list($width, $height) = getimagesize($file['tmp_name']);
  
      // Load
      $thumb = imagecreatetruecolor(600, 400);
  
      $wmext = explode(".",$file['name']);
      $wmext = end($wmext);
  
      switch ($wmext) {
          case 'jpg' :
              $source = imagecreatefromjpeg($file['tmp_name']);
              break;
          case 'png' :
              $source = imagecreatefrompng($file['tmp_name']);
              break;
          case 'gif' :
              $source = imagecreatefromgif($file['tmp_name']);
              break;
          default :
  //          progress_log("Resize error for image : $file");
      }
  
      // Resize
      imagecopyresized($thumb, $source, 0, 0, 0, 0, 600, 400, $width, $height);
  
      $final_file = "Thumb_".time()."_".$file['name'];
      imagejpeg($thumb,"uploads/".$final_file);
  
      //echo '&lt;img src="uploads/'.$final_file.'"&gt;';
      imagedestroy($thumb);
      return $final_file;
  }
  ?&gt;
  </code></pre>