{
//GIFOutputStream.writeGIF(outStream, image,GIFOutputStream.STANDARD_256_COLORS, mapCtx.getBgColor());
//DJB: note I had to make colorTable in the encoder source public to do this!
//DJB: to add a function "return colorTable.ciLookup.getPaletteIndex(rgb);" to Gif89Encoder
Gif89Encoder gifenc = new Gif89Encoder(image,mapCtx.getBgColor(),2 ); // 2= colour reduction pixel sample factor (1=look at all pixels, but its slow)
gifenc.setComments("produced by Geoserver");
gifenc.getFrameAt(0).setInterlaced(false);
gifenc.encode(outStream);
}
else
{
// GIFOutputStream.writeGIF(outStream, image);
Gif89Encoder gifenc = new Gif89Encoder(image,null,2);// 2= colour reduction pixel sample factor (1=look at all pixels, but its slow)
gifenc.setComments("produced by Geoserver");
// gifenc.setTransparentIndex(transparent_index);
gifenc.getFrameAt(0).setInterlaced(false);
gifenc.encode(outStream);
}
}