yes png, gif & jpeg are all on.
on all servers.
here's a better one that does the same thing:
$GDINFO=gd_info();
$GDGIF=($GDINFO["GIF Create Support"]) ? 1 : 0;
$ImageType=( $GDGIF ) ? "image/gif" : "image/png"; # or image/jpeg
if (empty($w)) $w=9;
if (empty($h)) $h=5;
$downvalues = array(
0 => 0, // x1
1 => 0, // y1
2 => ($w-1), // x2 $w-1 was 8
3 => 0, // y2
4 => $h, // x3 $h-1 was 4
5 => $h, // y3 $h-1
6 => 0, # x4
7 => 0 # y4
);
#========================================================================================
$im = imagecreate($w,$h);
define("WHITE",ImageColorAllocate($im, 0xFF,0xFF,0xFF));
define("BLACK",ImageColorAllocate($im, 0x0,0x0,0x0));
define("BLUE",ImageColorAllocate($im, 0x0,0x0,0xFF));
define("LIGHTBLUE",ImageColorAllocate($im, 0x66,0x99,0xFF));
define("DARKBLUE",ImageColorAllocate($im, 0x0,0x0,0x80));
$fgColor=LIGHTBLUE;
$bgColor=WHITE;
if ($color) {
$red=hexdec(substr($color,0,2));
$green=hexdec(substr($color,2,2));
$blue=hexdec(substr($color,4,2));
$fgColor=ImageColorAllocate($im, $red,$green,$blue);
}
if ($bgcolor) {
$red=hexdec(substr($bgcolor,0,2));
$green=hexdec(substr($bgcolor,2,2));
$blue=hexdec(substr($bgcolor,4,2));
$bgColor=ImageColorAllocate($im, $red,$green,$blue);
}
imagefill($im,0,0,$bgColor);
$img=imagefilledpolygon($im, $downvalues, 4, $fgColor);
if ($arrowdirection) {
switch(strtolower($arrowdirection)){
case "up":
$deg=180;
break;
case "left":
$deg=90;
break;
case "right":
$deg=-90;
break;
default:
$deg=0;
break;
}
$im=imagerotate($im, $deg, $bgColor);
} # end if direction
Header("Content-type: $ImageType");
closeimage($im,$ImageType);
imagedestroy($im);
############################
function closeimage($RESOURCE,$itype='png',$quality=80){
switch(preg_replace("/image\//","",$itype)){
case "gif": #GIF
imagegif($RESOURCE);
break;
case "jpeg": #Jpeg/jpg
imagejpeg($RESOURCE,'',$quality); #,$quality=80
break;
default:
imagepng($RESOURCE); #Default png
break;
}
} # end function
#End image