title: Display image in PHP (Laravel)
body: <p>I'm trying to display a png image in PHP (Laravel)</p>
  
  <p>So far I've tried </p>
  
  <pre><code>$response =  Response::make(readfile(public_path() . 
  "/img/$image_name.png", 200))-&gt;header('Content-Type', 'image/png');
  return $response;
  </code></pre>
  
  <p>and this</p>
  
  <pre><code>$file = public_path() . "/img/$image_name.png";
  $im = imagecreatefrompng($file);
  header('Content-Type: image/png');
  imagePNG($im);
  imagedestroy($im);
  </code></pre>
  
  <p>I always get something like this instead of an actual image</p>
  
  <pre><code>�PNG  IHDR:�c PLTE����&gt;tRNS�* �&lt; pHYs���+uIDAT(�eұ� AJs *́[P૒��@8Ҍ��Y�:����s�A�"D�!B�"D�!B�"D�!C~����}��Q��N�+'��bP�.a&amp;^O)%5Y\�L����.ޜ9��IEND�B`�
  </code></pre>
  
  <p>When I use jpeg header and jpeg image it starts showing the actual image in browser, but for some reason it doesn't work for png images. Have anyone faced a similar problem?</p>