Changeset 6355


Ignore:
Timestamp:
05/20/10 16:55:57 (9 years ago)
Author:
melissa
Message:

Don't swap bits if the number of bits per pixel is less than or equal to 8.

Files:
2 edited

Legend:

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

    r6350 r6355  
    831831            { 
    832832              value = bb.getBits(bps0) & 0xffff; 
    833               if (littleEndian) value = DataTools.swap(value) >> (32 - bps0); 
     833              if (littleEndian && bps0 > 8) { 
     834                value = DataTools.swap(value) >> (64 - bps0); 
     835              } 
    834836              if ((ndx % imageWidth) == imageWidth - 1 && bps0 < 8) { 
    835837                bb.skipBits(skipBits); 
  • trunk/components/bio-formats/src/loci/formats/tiff/TiffParser.java

    r6350 r6355  
    831831            { 
    832832              value = bb.getBits(bps0) & 0xffff; 
    833               if (littleEndian) value = DataTools.swap(value) >> (32 - bps0); 
     833              if (littleEndian && bps0 > 8) { 
     834                value = DataTools.swap(value) >> (64 - bps0); 
     835              } 
    834836              if ((ndx % imageWidth) == imageWidth - 1 && bps0 < 8) { 
    835837                bb.skipBits(skipBits); 
Note: See TracChangeset for help on using the changeset viewer.