title: Resize image using php Imagemagick
body: <p>Im trying to resize an image using imagemagick's function 'thumbnailImage'. Right now, im not doing anything with image afterwards, just echoing the new dimensions to see if it worked. And so far, it isnt working. Heres my code. NOTE: it does echo the original dimensions, just not the new ones. </p>
  
  <pre><code>$image = $_FILES["file"]["tmp_name"];
  
  //Get original dimensions
  list($width, $height, $type, $attr) = getimagesize($image);
  echo "&lt;BR&gt;";
  echo "ORIGINAL:";
  echo "&lt;BR&gt;";
  echo "Image width $width";
  echo "&lt;BR&gt;";
  echo "Image height " .$height;
  
  
  
    $max_height = 200;
      $max_width = 150;
  
   function thumbnail($image, $max_width, $max_height) {
          $img = new Imagick($image);
          $img-&gt;thumbnailImage($max_width, $max_height, TRUE);
          return $img;
      }
  thumbnail($image, $max_width, $max_height);
  
  //get new dimensions
      list($width, $height, $type, $attr) = getimagesize($img);
      echo "&lt;BR&gt;";
      echo "NEW:";
      echo "&lt;BR&gt;";
      echo "Image width $width";
      echo "&lt;BR&gt;";
      echo "Image height " .$height;
  </code></pre>
  
  <p>It isnt even displaying the second set of echo's. There are now errors. </p>