Changeset 13898

Show
Ignore:
Timestamp:
02/29/08 14:37:51 (4 months ago)
Author:
rouault
Message:

Fix #2249 : shift when writing NITF color table with nColors < 256

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/gdal/frmts/nitf/nitfdataset.cpp

    r13729 r13898  
    245245            sEntry.c2 = psBandInfo->pabyLUT[256 + iColor]; 
    246246            sEntry.c3 = psBandInfo->pabyLUT[512 + iColor]; 
    247             sEntry.c4 = (psImage->bNoDataSet && psImage->nNoDataValue == iColor) ? 0 : 255; 
     247            sEntry.c4 = 255; 
    248248 
    249249            poColorTable->SetColorEntry( iColor, &sEntry ); 
     250        } 
     251 
     252        if (psImage->bNoDataSet) 
     253        { 
     254            GDALColorEntry sEntry; 
     255            sEntry.c1 = sEntry.c2 = sEntry.c3 = sEntry.c4 = 0; 
     256            poColorTable->SetColorEntry( psImage->nNoDataValue, &sEntry ); 
    250257        } 
    251258    } 
  • trunk/gdal/frmts/nitf/nitfimage.c

    r13212 r13898  
    820820            psImage->bNoDataSet = TRUE; 
    821821            psImage->nNoDataValue = psBandInfo->nSignificantLUTEntries; 
    822             psBandInfo->nSignificantLUTEntries ++; 
    823822        } 
    824823    }