Page 1 of 1

GD headers for gif, png

Posted: Fri Jul 16, 2004 1:39 pm
by anjanesh
Hi
I have this in code :

Code: Select all

<?php
switch(strtolower(strrchr($_GET['filename'],".")))
 {
    case ".gif":header("Content-type: image/gif");break;
    case ".jpg":case".jpeg":header("Content-type: image/jpeg");break;
    case ".png":header("Content-type: image/png");break;
 }
.
.
.
.
?>
But only jpeg images are being displayed. Howz that ?
Thanks

Posted: Fri Jul 16, 2004 2:31 pm
by feyd
some browsers look for image/x-png IIRC.. as for gif, google says image/gif is correct..

Posted: Sat Jul 17, 2004 7:13 am
by anjanesh
For gif support according to php manual - Only supported in GD versions older than gd-1.6. Read-only GIF support is available with PHP 4.3.0 and the bundled GD-library.

PHP 5 has full gif support but the server has php 4.3.6 and I need to write gif files too since gif supports the transparency.

So now how do I get this working ? Any ideas ?

Posted: Sat Jul 17, 2004 8:53 am
by feyd
roll your own writer.