Changeset 6350


Ignore:
Timestamp:
05/20/10 12:25:35 (9 years ago)
Author:
melissa
Message:

Skip over TIFF tiles/strips that have StripByteCounts == 0. See  omero:2367.

Files:
2 edited

Legend:

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

    r6339 r6350  
    545545      stripByteCounts[tileNumber] *= pixel; 
    546546    } 
     547    int size = (int) (tileWidth * tileLength * pixel * effectiveChannels); 
     548    if (buf == null) buf = new byte[size]; 
     549    if (stripByteCounts[tileNumber] == 0) return buf; 
    547550    byte[] tile = new byte[(int) stripByteCounts[tileNumber]]; 
    548551    in.seek(stripOffsets[tileNumber]); 
    549552    in.read(tile); 
    550553 
    551     int size = (int) (tileWidth * tileLength * pixel * effectiveChannels); 
    552554    options.maxBytes = size; 
    553555 
     
    561563 
    562564    TiffCompression.undifference(tile, ifd); 
    563     if (buf == null) buf = new byte[size]; 
    564565    unpackBytes(buf, 0, tile, ifd); 
    565566 
  • trunk/components/bio-formats/src/loci/formats/tiff/TiffParser.java

    r6339 r6350  
    545545      stripByteCounts[tileNumber] *= pixel; 
    546546    } 
     547    int size = (int) (tileWidth * tileLength * pixel * effectiveChannels); 
     548    if (buf == null) buf = new byte[size]; 
     549    if (stripByteCounts[tileNumber] == 0) return buf; 
    547550    byte[] tile = new byte[(int) stripByteCounts[tileNumber]]; 
    548551    in.seek(stripOffsets[tileNumber]); 
    549552    in.read(tile); 
    550553 
    551     int size = (int) (tileWidth * tileLength * pixel * effectiveChannels); 
    552554    options.maxBytes = size; 
    553555 
     
    561563 
    562564    TiffCompression.undifference(tile, ifd); 
    563     if (buf == null) buf = new byte[size]; 
    564565    unpackBytes(buf, 0, tile, ifd); 
    565566 
Note: See TracChangeset for help on using the changeset viewer.