Changeset 3302


Ignore:
Timestamp:
10/19/07 10:54:16 (12 years ago)
Author:
melissa
Message:

Set indexed = false if the lookup table is too small.

Location:
trunk/loci/formats/in
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/formats/in/BaseTiffReader.java

    r3259 r3302  
    113113      int[] colorMap = 
    114114        (int[]) TiffTools.getIFDValue(ifds[0], TiffTools.COLOR_MAP); 
    115       if (colorMap == null) return null; 
     115      if (colorMap == null || colorMap.length < 65536 * 3) return null; 
    116116      short[][] table = new short[3][colorMap.length / 3]; 
    117117      int next = 0; 
     
    537537    core.metadataComplete[0] = true; 
    538538    core.indexed[0] = TiffTools.getIFDIntValue(ifds[0], 
    539       TiffTools.PHOTOMETRIC_INTERPRETATION) == TiffTools.RGB_PALETTE; 
     539      TiffTools.PHOTOMETRIC_INTERPRETATION) == TiffTools.RGB_PALETTE && 
     540      (get8BitLookupTable() != null || get16BitLookupTable() != null); 
     541    if (core.sizeC[0] == 1 && !core.indexed[0]) core.rgb[0] = false; 
    540542    core.falseColor[0] = false; 
    541543 
     
    556558          break; 
    557559        default: 
    558           core.pixelType[0] = FormatTools.UINT8; 
     560          core.pixelType[0] = FormatTools.INT8; 
    559561      } 
    560562    } 
  • trunk/loci/formats/in/ZeissLSMReader.java

    r3197 r3302  
    137137      core.sizeT[0] = ras.readInt(); 
    138138 
     139      if (isIndexed()) core.sizeC[0] = 3; 
    139140      if (c > core.sizeC[0] || c != 1) core.sizeC[0] = c; 
    140141      if (core.sizeC[0] == 0) core.sizeC[0]++; 
Note: See TracChangeset for help on using the changeset viewer.