title: PHP imagecopyresampled Does not seem to scale Resize Image
body: <p>Here is my code im not seeing my problem... Nay help would be thanked!</p>
  
  <p>Now it Uploads Changes Quality and Copy to my directory but the pixels remain the same on Big or Small Images</p>
  
  <p>Not sure where my problem as i have checked a few dozen examples and all look like my code im stuck any help would be great!</p>
  
  <pre><code>    //Upload Directory Build
      $uploaddir = './images/projects_data/' . $_POST['table'] . '/' . $id;
      $uploadfile = $uploaddir . '/' . $db_picture;
  
  if (isset($_FILES['images']['name'])) {
  //Make Full Directory
  if (!file_exists($uploaddir . '/full')) {
  mkdir($uploaddir . '/full', 0775, true);
  }
  
  //Upload Full Size Thumbnails
  foreach ($_FILES['images']['error'] as $key =&gt; $error) {
      if ($error == UPLOAD_ERR_OK) {
      $tmp_name = $_FILES['images']['tmp_name'][$key];
      $name = $_FILES['images']['name'][$key];
  
      //Max Height Width
  $maxwidth = 100;
  
      //Read filetype  
          $i = strrpos($name,".");  
      if (!$i) { return ""; }  
      $l = strlen($name) - $i;  
      $extension = substr($name,$i+1,$l);  
      $extension = strtolower($extension);
  
      if ($extension=="jpg" || $extension=="jpeg" || $extension=="pjpeg" ) {$modifiedimage = imagecreatefromjpeg($tmp_name);} 
  elseif ($extension=="png") {$modifiedimage = imagecreatefrompng($tmp_name);} 
  elseif ($extension=="gif") {$modifiedimage = imagecreatefromgif($tmp_name);}  
  
  list($width,$height)=getimagesize($tmp_name);  
  
      //Change dimensions  
      $newwidth = $maxwidth;  
      $newheight = ($height/$width)*$newwidth;  
  
  //Create Image And Copy
      $newdim = imagecreatetruecolor($newwidth,$newheight);  
      imagecopyresampled($newdim,$modifiedimage,0,0,0,0,$newwidth,$newheight,$width,$height);  
      imagejpeg($modifiedimage,$uploaddir . '/full/' . $name,60);  
  
      // Remove temp images  
      imagedestroy($modifiedimage);  
      imagedestroy($newdim);  
  
      //move_uploaded_file($tmp_name, $uploaddir . '/full/' . $name);
  echo '&lt;span class="mainpagefontadmin"&gt;Project Photo Uploaded - Data Saved to: ' . $uploaddir . '/full/' . $name . '&lt;/span&gt;&lt;br&gt;';
  
      }
  }
  </code></pre>