Changeset 13899

Show
Ignore:
Timestamp:
02/29/08 14:40:30 (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
  • branches/1.5/gdal/frmts/nitf/nitfdataset.cpp

    r13356 r13899  
    244244            sEntry.c2 = psBandInfo->pabyLUT[256 + iColor]; 
    245245            sEntry.c3 = psBandInfo->pabyLUT[512 + iColor]; 
    246             sEntry.c4 = (psImage->bNoDataSet && psImage->nNoDataValue == iColor) ? 0 : 255; 
     246            sEntry.c4 = 255; 
    247247 
    248248            poColorTable->SetColorEntry( iColor, &sEntry ); 
     249        } 
     250 
     251        if (psImage->bNoDataSet) 
     252        { 
     253            GDALColorEntry sEntry; 
     254            sEntry.c1 = sEntry.c2 = sEntry.c3 = sEntry.c4 = 0; 
     255            poColorTable->SetColorEntry( psImage->nNoDataValue, &sEntry ); 
    249256        } 
    250257    } 
  • branches/1.5/gdal/frmts/nitf/nitfimage.c

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