Changeset 2456


Ignore:
Timestamp:
03/15/07 08:06:51 (13 years ago)
Author:
melissa
Message:

Calculate plane size based on the RGB channel count, not sizeC.

File:
1 edited

Legend:

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

    r2455 r2456  
    153153    while (bpp % 8 != 0) bpp++; 
    154154    byte[] buf = new byte[sizeX[series] * sizeY[series] * 
    155       (bpp / 8) * sizeC[series]]; 
     155      (bpp / 8) * getRGBChannelCount(id)]; 
    156156    return openBytes(id, no, buf); 
    157157  } 
     
    167167    while (bpp % 8 != 0) bpp++; 
    168168    int bytes = bpp / 8; 
    169     if (buf.length < sizeX[series] * sizeY[series] * bytes * sizeC[series]) { 
     169    if (buf.length < sizeX[series] * sizeY[series] * bytes *  
     170      getRGBChannelCount(id))  
     171    { 
    170172      throw new FormatException("Buffer too small."); 
    171173    } 
     
    173175    int offset = ((Long) offsets.get(series)).intValue(); 
    174176    in.seek(offset + 
    175       sizeX[series] * sizeY[series] * bytes * no * sizeC[series]); 
     177      sizeX[series] * sizeY[series] * bytes * no * getRGBChannelCount(id)); 
     178    
    176179    in.read(buf); 
    177180    updateMinMax(buf, no); 
Note: See TracChangeset for help on using the changeset viewer.