Changeset 6063


Ignore:
Timestamp:
03/23/10 13:48:58 (10 years ago)
Author:
melissa
Message:

Allow the number of samples per pixel to be greater than the size of the BitsPerSample array.

File:
1 edited

Legend:

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

    r6034 r6063  
    539539    int samplesPerPixel = getSamplesPerPixel(); 
    540540    if (bitsPerSample.length < samplesPerPixel) { 
    541       throw new FormatException("BitsPerSample length (" + 
    542         bitsPerSample.length + ") does not match SamplesPerPixel (" + 
    543         samplesPerPixel + ")"); 
     541      LOGGER.debug("BitsPerSample length ({}) does not match " + 
     542        "SamplesPerPixel ({})", bitsPerSample.length, samplesPerPixel); 
     543      int bits = bitsPerSample[0]; 
     544      bitsPerSample = new int[samplesPerPixel]; 
     545      Arrays.fill(bitsPerSample, bits); 
    544546    } 
    545547    int nSamples = (int) Math.min(bitsPerSample.length, samplesPerPixel); 
Note: See TracChangeset for help on using the changeset viewer.