function throwImage($e)
{
    global $width, $height;
    $image = imagecreate($width, $height);
    $transparent = ImageColorAllocate($image, 155, 155, 155);
    ImageFilledRectangle($image, 0, 0, $width, $height, $transparent);
    imagecolortransparent($image, $transparent);
    $text_color = ImageColorAllocate($image, 233, 14, 91);
    if (count($e) > 1) {
        for ($i = 0; $i < count($e); $i++) {
            ImageString($image, 3, 5, $i * 20, $e[$i], $text_color);
        }
    } else {
        ImageString($image, 3, 5, $i * 20, $e, $text_color);
    }
    responseImage($image);
}
function throwImage($e)
{
    global $reqParams;
    if (!$reqParams['width'] || !$reqParams['height']) {
        //width or height are not set by ows request - maybe for legendgraphics
        $width = 300;
        $height = 20;
    }
    $image = imagecreate($width, $height);
    $transparent = ImageColorAllocate($image, 155, 155, 155);
    ImageFilledRectangle($image, 0, 0, $width, $height, $transparent);
    imagecolortransparent($image, $transparent);
    $text_color = ImageColorAllocate($image, 233, 14, 91);
    for ($i = 0; $i < count($e); $i++) {
        ImageString($image, 3, 5, $i * 20, $e[$i], $text_color);
    }
    responseImage($image);
}