Changeset 2724


Ignore:
Timestamp:
05/02/07 14:04:17 (13 years ago)
Author:
melissa
Message:

Fixed several trivial bugs.

Location:
trunk/loci/formats
Files:
5 edited

Legend:

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

    r2701 r2724  
    156156  } 
    157157 
    158   public void close() { 
     158  public void close() throws IOException { 
     159    super.close();  
    159160    lastImage = null; 
    160161    lastImageIndex = -1; 
  • trunk/loci/formats/TiffTools.java

    r2711 r2724  
    996996          if (bitsPerSample[i] != 0) { 
    997997            rowsPerStripArray[i] = (long) stripByteCounts[i] / 
    998               (imageLength * (bitsPerSample[i] / 8)); 
     998              (imageWidth * (bitsPerSample[i] / 8)); 
    999999          } 
    10001000          else if (bitsPerSample[i] == 0 && i > 0) { 
    10011001            rowsPerStripArray[i] = (long) stripByteCounts[i] / 
    1002               (imageLength * (bitsPerSample[i - 1] / 8)); 
     1002              (imageWidth * (bitsPerSample[i - 1] / 8)); 
    10031003            bitsPerSample[i] = bitsPerSample[i - 1]; 
    10041004          } 
     
    10101010        else if (i >= bitsPerSample.length) { 
    10111011          rowsPerStripArray[i] = (long) stripByteCounts[i] / 
    1012             (imageLength * (bitsPerSample[bitsPerSample.length - 1] / 8)); 
     1012            (imageWidth * (bitsPerSample[bitsPerSample.length - 1] / 8)); 
    10131013        } 
    10141014      } 
     
    13851385      // ByteBuffer to transform to a ShortBuffer. Finally, use the ShortBuffer 
    13861386      // bulk get method to copy the data into a usable form for makeImage(). 
    1387       //int len = samples.length == 2 ? 3 : samples.length; 
    1388       short[][] sampleData = new short[samplesPerPixel][samples[0].length / 2]; 
    1389       for (int i = 0; i < sampleData.length; i++) { 
     1387      int len = samples.length == 2 ? 3 : samples.length; 
     1388       
     1389      short[][] sampleData = new short[len][samples[0].length / 2]; 
     1390      for (int i = 0; i < samplesPerPixel; i++) { 
    13901391        ShortBuffer sampleBuf = ByteBuffer.wrap(samples[i]).asShortBuffer(); 
    13911392        sampleBuf.get(sampleData[i]); 
  • trunk/loci/formats/in/PerkinElmerReader.java

    r2701 r2724  
    7272    FormatTools.assertId(currentId, true, 1); 
    7373    if (isTiff) { 
     74      tiff[no / core.sizeC[0]].setId(files[no / core.sizeC[0]]);  
    7475      return tiff[no / core.sizeC[0]].openBytes(0); 
    7576    } 
     
    339340      tiff[i] = new TiffReader(); 
    340341      if (i > 0) tiff[i].setMetadataCollected(false); 
    341       tiff[i].setId(files[i]); 
     342      //tiff[i].setId(files[i]); 
    342343    } 
    343344 
     
    548549 
    549550    core.sizeT[0] = getImageCount() / (core.sizeZ[0] * core.sizeC[0]); 
    550     if (isTiff) core.pixelType[0] = tiff[0].getPixelType(); 
     551    if (isTiff) { 
     552      tiff[0].setId(files[0]);  
     553      core.pixelType[0] = tiff[0].getPixelType(); 
     554    }  
    551555    else { 
    552556      int bpp = openBytes(0).length / (core.sizeX[0] * core.sizeY[0]); 
  • trunk/loci/formats/in/PrairieReader.java

    r2701 r2724  
    203203      else if (id.endsWith("cfg")) { 
    204204        if (metadata == null) metadata = new Hashtable(); 
     205        if (core == null) core = new CoreMetadata(1);  
    205206        cfgFile = id; 
    206207        readCFG = true; 
  • trunk/loci/formats/in/ZeissZVIReader.java

    r2701 r2724  
    785785  /** Parse a tag and place it in the metadata hashtable. */ 
    786786  private void parseTag(String data, int tagID, int attribute) { 
     787    if (data == null || data.length() == 0) return;  
    787788    switch (tagID) { 
    788789      case 222: 
Note: See TracChangeset for help on using the changeset viewer.