Changeset 4806


Ignore:
Timestamp:
02/16/09 10:03:34 (11 years ago)
Author:
melissa
Message:

Fixed minor bugs exposed by test suite.

Location:
trunk/components/bio-formats/src/loci/formats
Files:
7 edited

Legend:

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

    r4797 r4806  
    325325      Hashtable ifd = getIFD(in, ifdNum, offset, bigTiff); 
    326326      if (ifd == null || ifd.size() <= 1) break; 
    327       v.add(ifd); 
     327      // if width or length entries are not present, the IFD is invalid 
     328      if (ifd.get(new Integer(IMAGE_WIDTH)) != null && 
     329        ifd.get(new Integer(IMAGE_LENGTH)) != null) 
     330      { 
     331        v.add(ifd); 
     332      } 
    328333      offset = bigTiff ? in.readLong() : (long) (in.readInt() & 0xffffffffL); 
    329334      if (offset <= 0 || offset >= in.length()) break; 
  • trunk/components/bio-formats/src/loci/formats/in/ARFReader.java

    r4781 r4806  
    105105    in.skipBytes(2); // 'AR' signature 
    106106    int version = in.readUnsignedShort(); 
     107    int width = in.readUnsignedShort(); 
    107108    int height = in.readUnsignedShort(); 
    108     int width = in.readUnsignedShort(); 
    109109    int bitsPerPixel = in.readUnsignedShort(); 
    110110    int numImages = version == 2 ? in.readUnsignedShort() : 1; 
  • trunk/components/bio-formats/src/loci/formats/in/MetamorphReader.java

    r4803 r4806  
    448448 
    449449      int index = getIndex(0, i, 0); 
    450       if (index < wave.length && (int) wave[index] >= 1) { 
     450      if (wave != null && index < wave.length && (int) wave[index] >= 1) { 
    451451        store.setLightSourceSettingsWavelength( 
    452452          new Integer((int) wave[index]), 0, i); 
  • trunk/components/bio-formats/src/loci/formats/in/ND2Reader.java

    r4757 r4806  
    662662      core[i].sizeZ = getSizeZ(); 
    663663      core[i].sizeT = getSizeT(); 
    664       core[i].imageCount = getImageCount(); 
     664      core[i].imageCount = getSizeZ() * getSizeT() * (isRGB() ? 1 : getSizeC()); 
    665665      core[i].dimensionOrder = "XYCZT"; 
    666666      core[i].sizeX = x; 
  • trunk/components/bio-formats/src/loci/formats/in/PSDReader.java

    r4791 r4806  
    226226      int layerCount = in.readShort(); 
    227227 
    228       if (layerCount <= 0) { 
     228      if (layerCount < 0) { 
    229229        throw new FormatException("Vector data is not supported."); 
    230230      } 
  • trunk/components/bio-formats/src/loci/formats/in/TiffReader.java

    r4521 r4806  
    7272      metadata.remove("Comment"); 
    7373 
    74       core[0].sizeZ = 1; 
    75       core[0].sizeT = 1; 
     74      int z = 1, t = 1; 
     75      int c = getSizeC(); 
    7676 
    7777      // parse ZCT sizes 
     
    9090        } 
    9191 
    92         if (token.startsWith("channels=")) { 
    93           core[0].sizeC = value; 
    94         } 
    95         else if (token.startsWith("slices=")) { 
    96           core[0].sizeZ = value; 
    97         } 
    98         else if (token.startsWith("frames=")) { 
    99           core[0].sizeT = value; 
    100         } 
     92        if (token.startsWith("channels=")) c = value; 
     93        else if (token.startsWith("slices=")) z = value; 
     94        else if (token.startsWith("frames=")) t = value; 
    10195      } 
    102       if (getSizeZ() * getSizeT() * getSizeC() == getSizeC()) { 
    103         core[0].sizeT = getImageCount(); 
     96      if (z * c * t == c) { 
     97        t = getImageCount(); 
    10498      } 
    10599      core[0].dimensionOrder = "XYCZT"; 
     100 
     101      if (z * t * (isRGB() ? 1 : c) == ifds.length) { 
     102        core[0].sizeZ = z; 
     103        core[0].sizeT = t; 
     104        core[0].sizeC = c; 
     105      } 
     106      else { 
     107        core[0].sizeT = ifds.length; 
     108        core[0].imageCount = ifds.length; 
     109      } 
    106110    } 
    107111 
  • trunk/components/bio-formats/src/loci/formats/in/TillVisionReader.java

    r4750 r4806  
    362362    for (int i=0; i<getSeriesCount(); i++) { 
    363363      // populate Image data 
    364       store.setImageName((String) imageNames.get(i), i); 
     364      if (i < imageNames.size()) { 
     365        store.setImageName((String) imageNames.get(i), i); 
     366      } 
    365367      String date = i < dates.size() ? (String) dates.get(i) : ""; 
    366368      if (!date.equals("")) { 
Note: See TracChangeset for help on using the changeset viewer.