title: PHP imagejpeg does not work
body: <p>Using this logic to resize and print an image:</p>
  
  <pre><code>$image_path="path/to/image.extension";  
  $image_path=imagecreatefromjpeg($image_path);  
  
  $width=imagesx($image_path);  
  $height=imagesy($image_path);  
  $new_image=imagecreatetruecolor($w, $h);  
  imagecopyresampled($new_image,$image_path,0,0,0,0,$w,$h,$width,$height);  
  header('Content-Type: image/jpeg');  
  imagejpeg($new_image,100);
  imagedestroy($new_image);
  </code></pre>
  
  <p>But I am getting image missing icon as output. What is the mistake I do? I have tried printing the variables <code>$width</code> and <code>$height</code> and it prints the dimension of source image. So the path is correct.</p>
  
  <p>What could be the error?</p>