Changeset 5994


Ignore:
Timestamp:
03/05/10 16:04:22 (10 years ago)
Author:
melissa
Message:

Adjust strip byte counts if they do not match up with the number of rows per strip.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/components/bio-formats/src/loci/formats/tiff/TiffParser.java

    r5972 r5994  
    582582    long[] stripOffsets = ifd.getStripOffsets(); 
    583583    long[] stripByteCounts = ifd.getStripByteCounts(); 
     584    long[] rowsPerStrip = ifd.getRowsPerStrip(); 
    584585 
    585586    int tileNumber = (int) (row * numTileCols + col); 
     587    if (stripByteCounts[tileNumber] == (rowsPerStrip[tileNumber] * tileWidth) && 
     588      pixel > 1) 
     589    { 
     590      stripByteCounts[tileNumber] *= pixel; 
     591    } 
     592 
    586593    byte[] tile = new byte[(int) stripByteCounts[tileNumber]]; 
    587594    in.seek(stripOffsets[tileNumber]); 
     
    702709 
    703710      int tile = (int) ((y / tileLength) * numTileCols + (x / tileWidth)); 
     711 
     712      if (stripByteCounts[tile] == numSamples && pixel > 1) { 
     713        stripByteCounts[tile] *= pixel; 
     714      } 
     715 
    704716      in.seek(stripOffsets[tile]); 
    705717      in.read(buf, 0, (int) Math.min(buf.length, stripByteCounts[tile])); 
Note: See TracChangeset for help on using the changeset viewer.