Changeset 7254 for trunk


Ignore:
Timestamp:
11/26/10 15:32:17 (9 years ago)
Author:
melissa
Message:

Fixed small bug in r7236 that prevented multi-channel 16-bit BufferedImages from being unpacked correctly.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/components/bio-formats/src/loci/formats/in/BIFormatReader.java

    r7236 r7254  
    7474        break; 
    7575      case 16: 
    76         short[] ts = AWTImageTools.getShorts(data)[0]; 
    77         for (int i=0; i<ts.length && i < buf.length*2; i++) { 
    78           DataTools.unpackBytes(ts[i], buf, i * 2, 2, isLittleEndian()); 
     76        short[][] ts = AWTImageTools.getShorts(data); 
     77        for (int c=0; c<ts.length; c++) { 
     78          int offset = c * ts[c].length * 2; 
     79          for (int i=0; i<ts[c].length && offset < buf.length; i++) { 
     80            DataTools.unpackBytes(ts[c][i], buf, offset, 2, isLittleEndian()); 
     81            offset += 2; 
     82          } 
    7983        } 
    8084        break; 
Note: See TracChangeset for help on using the changeset viewer.