Changeset 3915


Ignore:
Timestamp:
04/11/08 14:38:03 (12 years ago)
Author:
melissa
Message:
  • Fixed calculation of fake strip byte counts.
  • PrairieReader should always group files, even if the input file is a TIFF.
Location:
trunk/loci/formats
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/formats/TiffTools.java

    r3914 r3915  
    10101010      long temp = stripByteCounts[0]; 
    10111011      stripByteCounts = new long[bitsPerSample.length]; 
    1012       for (int i=0; i<stripByteCounts.length; i++) stripByteCounts[i] = temp; 
     1012      Arrays.fill(stripByteCounts, temp); 
    10131013      temp = bitsPerSample[0]; 
    10141014      if (temp == 0) temp = 8; 
    10151015      bitsPerSample = new int[bitsPerSample.length]; 
    1016       for (int i=0; i<bitsPerSample.length; i++) bitsPerSample[i] = (int) temp; 
     1016      Arrays.fill(bitsPerSample, (int) temp); 
    10171017      temp = stripOffsets[0]; 
    10181018 
     
    10921092      } 
    10931093 
    1094       for (int i=0; i<stripByteCounts.length; i++) { 
    1095         stripByteCounts[i] *= 2; 
    1096       } 
     1094      //for (int i=0; i<stripByteCounts.length; i++) { 
     1095      //  stripByteCounts[i] *= 2; 
     1096      //} 
    10971097    } 
    10981098 
     
    16461646 
    16471647          int ndx = startIndex + j; 
     1648          if (i*nSamples + ndx >= samples.length) break; 
     1649 
    16481650          if (photoInterp != Y_CB_CR) { 
    16491651            samples[i*nSamples + ndx] = (byte) (bytes[index++] & 0xff); 
     
    18281830        } 
    18291831        for (int i=0; i<s.length; i++) { 
    1830           input[little ? i*2 + 1: i*2] = (byte) (s[i] & 0xff); 
    1831           input[little ? i*2 : i*2 + 1] = (byte) ((s[i] >> 8) & 0xff); 
     1832          DataTools.unpackShort(s[i], input, i*2, little); 
    18321833        } 
    18331834      } 
  • trunk/loci/formats/in/PrairieReader.java

    r3906 r3915  
    144144  /* @see loci.formats.IFormatReader#fileGroupOption(String) */ 
    145145  public int fileGroupOption(String id) throws FormatException, IOException { 
    146     id = id.toLowerCase(); 
    147     return (checkSuffix(id, PRAIRIE_SUFFIXES)) ? 
    148       FormatTools.MUST_GROUP : FormatTools.CAN_GROUP; 
     146    return FormatTools.MUST_GROUP; 
    149147  } 
    150148 
Note: See TracChangeset for help on using the changeset viewer.