Ticket #985 (closed defect: wontfix)
i cann't write color table into ERDAS image
| Reported by: | wjimage@… | Owned by: | mloskot |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | GDAL_Raster | Version: | unspecified |
| Severity: | normal | Keywords: | hfa |
| Cc: | warmerdam |
Description (last modified by warmerdam) (diff)
the data of the output file is ok.
just the function :
cErr = GDALSetRasterColorInterpretation( pDstBand, GCI_PaletteIndex );
failed.
the source is:
// the following function return "CE_Failure"
cErr = GDALSetRasterColorInterpretation( pDstBand, GCI_PaletteIndex );
hTable = GDALCreateColorTable(GPI_RGB);
// the following function return CE_None
cErr = GDALSetColorEntry( hTable, nClassNum, pColor );
the erdas image is created in my program.and the image data is ok.
the color table part when using gdalinfo is:
here: nClassNum = 6;
colorinterp = palette
color table <RGB with 7 entries>
but the color entries is incorrect:
1-6 entries are all zero
7 is: 0,0,255,1 is the first element of pColor.
i have traced the function
void GDALColorTable::SetColorEntry( int i, const GDALColorEntry * poEntry )
{
if( i < 0 )
return;
if( i >= static_cast<int>(aoEntries.size()) )
{
GDALColorEntry oBlack;
oBlack.c1 = oBlack.c2 = oBlack.c3 = oBlack.c4 = 0;
aoEntries.resize(i+1, oBlack);
}
aoEntries[i] = *poEntry;
}
it seems that the program enter the if statement.
Change History
Note: See
TracTickets for help on using
tickets.
