Hi
See this page:
http://207.44.137.103/gdtest.htm
It has one small png image created by the GD Library.
If you right mouse click on it to save the image, in IE it gives you the name:
centercolbg
and the filetype of png.
Opera gives you the right filetype and the name:
centercolbg.png
In Mozilla it gives you the same filetype, but it names the file:
centercolbg.php.png
I have been told that in Safari (I think that was it) or at least some other browser it gave a filetype of bmp.
Is there any way to fix this behavior or is it a browser issue. What I mean is, can I fix it from my end in php?
this is the gdtest page code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>GD Test</title>
</head>
<body>
<img class="saveimages" src="centercolbg.php?color=ADD8E6&x_size=478&y_size=20
" height="50" width="50" alt="" />
</body>
</html>
and this is the code for the centercolbg php file:
<?php
header ("Content-type: image/png");
$newImg = ImageCreate($_GET['x_size'],$_GET['y_size']);
$color = imagecolorallocate($newImg,hexdec(substr($_GET['color'],0,2)),hexdec(substr($_GET['color'],2,2)),hexdec(substr($_GET['color'],4,2)));
ImageFill($newImg,0,0,$color);
ImagePNG($newImg);
ImageDestroy($newImg);
?>
Trevor