Changeset 7465


Ignore:
Timestamp:
12/27/10 13:34:20 (9 years ago)
Author:
melissa
Message:

Fixed how EPS images with two channels are handled. Closes #631.

File:
1 edited

Legend:

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

    r6881 r7465  
    100100        int ndx = b[i] & 0xff; 
    101101        for (int j=0; j<getSizeC(); j++) { 
    102           buf[i*getSizeC() + j] = (byte) map[ndx + j*256]; 
     102          if (j < 3) { 
     103            buf[i*getSizeC() + j] = (byte) map[ndx + j*256]; 
     104          } 
     105          else { 
     106            boolean zero = 
     107              map[ndx] == 0 && map[ndx + 256] == 0 && map[ndx + 512] == 0; 
     108            buf[i * getSizeC() + j] = zero ? (byte) 0 : (byte) 255; 
     109          } 
    103110        } 
    104111      } 
     
    188195      core[0].sizeT = 1; 
    189196      core[0].sizeC = firstIFD.getSamplesPerPixel(); 
     197      if (getSizeC() == 2) core[0].sizeC = 4; 
    190198      core[0].littleEndian = firstIFD.isLittleEndian(); 
    191199      core[0].interleaved = true; 
Note: See TracChangeset for help on using the changeset viewer.