title: Image resize without saving
body: <p>I am trying to use PHP to grab a jpg image from a url and resize it and then display it in a webpage without having to save the new resized image.
  My issue is that the image is not being shown to the page just a small blank square is being shown in my browser when I test the page with this script.</p>
  
  <pre><code>    &lt;?php
         $source_image = imagecreatefromjpeg("https://www.******.com/blog/post/b/l/health.jpg");
         $source_imagex = imagesx($source_image);
         $source_imagey = imagesy($source_image);
         $dest_imagex = 300;
         $dest_imagey = 200;
         $dest_image = imagecreatetruecolor($dest_imagex, $dest_imagey);
         imagecopyresampled($dest_image, $source_image, 0, 0, 0, 0, 
         $dest_imagex, 
         $dest_imagey, $source_imagex, $source_imagey);
         header("Content-Type: image/jpeg");
         imagejpeg($dest_image,NULL,80);
     ?&gt;
  
  &lt;img src='&lt;?php echo "$dest_image";?&gt;'&gt;
  </code></pre>