Posted By

BenJD on 02/22/11


Tagged

graphics


Versions (?)

Serve .gif image


 / Published in: PHP
 

Serve a gif image directly using php code. In this case we could also 301 redirect to the gif which may be more efficient.

  1. $imagepath="filename.gif";
  2.  
  3. $image=imagecreatefromgif($imagepath);
  4.  
  5. header('Content-Type: image/gif');
  6.  
  7. imagegif($image);

Report this snippet  

You need to login to post a comment.