Changeset 4899


Ignore:
Timestamp:
03/10/09 09:41:08 (11 years ago)
Author:
melissa
Message:

Fixed a couple of regression bugs in TiffTools.

File:
1 edited

Legend:

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

    r4895 r4899  
    11511151    } 
    11521152 
     1153    int compression = getCompression(ifd); 
    11531154    int photoInterp = getPhotometricInterpretation(ifd); 
     1155    if (compression == JPEG) photoInterp = RGB; 
     1156 
    11541157    int[] bitsPerSample = getBitsPerSample(ifd); 
    11551158    int nChannels = bitsPerSample.length; 
     
    12151218          } 
    12161219 
    1217           if (outputIndex + numBytes + 1 <= samples.length) { 
    1218             DataTools.unpackBytes(s, samples, outputIndex, 
    1219               numBytes + 1, littleEndian); 
     1220          if (outputIndex + numBytes <= samples.length) { 
     1221            DataTools.unpackBytes(s, samples, outputIndex, numBytes, 
     1222              littleEndian); 
    12201223          } 
    12211224        } 
     
    21542157    int tag = isTiled(ifd) ? TILE_OFFSETS : STRIP_OFFSETS; 
    21552158    long[] offsets = getIFDLongArray(ifd, tag, false); 
     2159    if (isTiled(ifd) && offsets == null) { 
     2160      offsets = getIFDLongArray(ifd, STRIP_OFFSETS, false); 
     2161    } 
     2162 
    21562163    if (isTiled(ifd)) return offsets; 
    21572164    long rowsPerStrip = getRowsPerStrip(ifd)[0]; 
     
    21792186    int tag = isTiled(ifd) ? TILE_BYTE_COUNTS : STRIP_BYTE_COUNTS; 
    21802187    long[] byteCounts = getIFDLongArray(ifd, tag, false); 
     2188    if (isTiled(ifd) && byteCounts == null) { 
     2189      byteCounts = getIFDLongArray(ifd, STRIP_BYTE_COUNTS, false); 
     2190    } 
    21812191    if (byteCounts == null) { 
    21822192      // technically speaking, this shouldn't happen (since TIFF writers are 
Note: See TracChangeset for help on using the changeset viewer.