Changeset 6368


Ignore:
Timestamp:
05/24/10 16:56:51 (10 years ago)
Author:
melissa
Message:

A few more LSM-related fixes.

Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/4.2/components/bio-formats/src/loci/formats/in/ZeissLSMReader.java

    r6361 r6368  
    280280  } 
    281281 
     282  /* @see loci.formats.IFormatReader#setSeries(int) */ 
     283  public void setSeries(int series) { 
     284    if (series != getSeries()) { 
     285      prevBuf = null; 
     286    } 
     287    super.setSeries(series); 
     288  } 
     289 
    282290  /** 
    283291   * @see loci.formats.IFormatReader#openBytes(int, byte[], int, int, int, int) 
     
    353361      long[] ifdOffsets = tp.getIFDOffsets(); 
    354362      IFDList ifds = new IFDList(); 
    355       for (int offset=0; offset<ifdOffsets.length; offset+=2) { 
     363      for (int offset=0; offset<ifdOffsets.length;) { 
    356364        ifds.add(tp.getIFD(ifdOffsets[offset])); 
     365        if (ifds.get(0).containsKey(ZEISS_ID)) offset += 2; 
     366        else offset++; 
    357367      } 
    358368      ifdsList.set(i, ifds); 
     
    384394        boolean neededAdjustment = false; 
    385395        for (int j=0; j<stripOffsets.length; j++) { 
     396          if (j >= previousStripOffsets.length) break; 
    386397          if (stripOffsets[j] < previousStripOffsets[j]) { 
    387398            stripOffsets[j] = (previousStripOffsets[j] & ~0xffffffffL) | 
     
    604615    } 
    605616 
    606     if (isIndexed()) core[series].rgb = false; 
    607617    if (getEffectiveSizeC() == 0) { 
    608618      core[series].imageCount = getSizeZ() * getSizeT(); 
     
    635645 
    636646    MetadataTools.setDefaultCreationDate(store, getCurrentFile(), series); 
    637     int nLogicalChannels = nextDataChannel == 0 ? 1 : nextDataChannel; 
    638     if (nLogicalChannels == getSizeC() || nextDataChannel == 0) { 
     647    if (getSizeC() > 1) { 
    639648      if (!splitPlanes) splitPlanes = isRGB(); 
    640649      core[series].rgb = false; 
  • branches/4.2/components/bio-formats/src/loci/formats/tiff/TiffParser.java

    r6361 r6368  
    547547    int size = (int) (tileWidth * tileLength * pixel * effectiveChannels); 
    548548    if (buf == null) buf = new byte[size]; 
    549     if (stripByteCounts[tileNumber] == 0) return buf; 
     549    if (stripByteCounts[tileNumber] == 0 || 
     550      stripOffsets[tileNumber] >= in.length()) 
     551    { 
     552      return buf; 
     553    } 
    550554    byte[] tile = new byte[(int) stripByteCounts[tileNumber]]; 
    551555    in.seek(stripOffsets[tileNumber]); 
  • branches/4.2/components/forks/mdbtools/src/mdbtools/libmdb/Data.java

    r6190 r6368  
    880880        } 
    881881        row_start = file.mdb_get_int16(mdb, 10 + ole_row * 2); 
     882        if (row_start > row_stop) row_start = 0; 
    882883//#if MDB_DEBUG_OLE 
    883884//  printf("row num %d row start %d row stop %d\n", ole_row, row_start, row_stop); 
  • trunk/components/bio-formats/src/loci/formats/in/ZeissLSMReader.java

    r6361 r6368  
    280280  } 
    281281 
     282  /* @see loci.formats.IFormatReader#setSeries(int) */ 
     283  public void setSeries(int series) { 
     284    if (series != getSeries()) { 
     285      prevBuf = null; 
     286    } 
     287    super.setSeries(series); 
     288  } 
     289 
    282290  /** 
    283291   * @see loci.formats.IFormatReader#openBytes(int, byte[], int, int, int, int) 
     
    353361      long[] ifdOffsets = tp.getIFDOffsets(); 
    354362      IFDList ifds = new IFDList(); 
    355       for (int offset=0; offset<ifdOffsets.length; offset+=2) { 
     363      for (int offset=0; offset<ifdOffsets.length;) { 
    356364        ifds.add(tp.getIFD(ifdOffsets[offset])); 
     365        if (ifds.get(0).containsKey(ZEISS_ID)) offset += 2; 
     366        else offset++; 
    357367      } 
    358368      ifdsList.set(i, ifds); 
     
    384394        boolean neededAdjustment = false; 
    385395        for (int j=0; j<stripOffsets.length; j++) { 
     396          if (j >= previousStripOffsets.length) break; 
    386397          if (stripOffsets[j] < previousStripOffsets[j]) { 
    387398            stripOffsets[j] = (previousStripOffsets[j] & ~0xffffffffL) | 
     
    604615    } 
    605616 
    606     if (isIndexed()) core[series].rgb = false; 
    607617    if (getEffectiveSizeC() == 0) { 
    608618      core[series].imageCount = getSizeZ() * getSizeT(); 
     
    635645 
    636646    MetadataTools.setDefaultCreationDate(store, getCurrentFile(), series); 
    637     int nLogicalChannels = nextDataChannel == 0 ? 1 : nextDataChannel; 
    638     if (nLogicalChannels == getSizeC() || nextDataChannel == 0) { 
     647    if (getSizeC() > 1) { 
    639648      if (!splitPlanes) splitPlanes = isRGB(); 
    640649      core[series].rgb = false; 
  • trunk/components/bio-formats/src/loci/formats/tiff/TiffParser.java

    r6361 r6368  
    547547    int size = (int) (tileWidth * tileLength * pixel * effectiveChannels); 
    548548    if (buf == null) buf = new byte[size]; 
    549     if (stripByteCounts[tileNumber] == 0) return buf; 
     549    if (stripByteCounts[tileNumber] == 0 || 
     550      stripOffsets[tileNumber] >= in.length()) 
     551    { 
     552      return buf; 
     553    } 
    550554    byte[] tile = new byte[(int) stripByteCounts[tileNumber]]; 
    551555    in.seek(stripOffsets[tileNumber]); 
  • trunk/components/forks/mdbtools/src/mdbtools/libmdb/Data.java

    r6190 r6368  
    880880        } 
    881881        row_start = file.mdb_get_int16(mdb, 10 + ole_row * 2); 
     882        if (row_start > row_stop) row_start = 0; 
    882883//#if MDB_DEBUG_OLE 
    883884//  printf("row num %d row start %d row stop %d\n", ole_row, row_start, row_stop); 
Note: See TracChangeset for help on using the changeset viewer.