Changeset 7260 for branches/4.2


Ignore:
Timestamp:
11/29/10 10:13:25 (10 years ago)
Author:
melissa
Message:
  • Skip over empty .lsm files instead of throwing an EOFException.
  • Slightly sped up metadata parsing.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/4.2/components/bio-formats/src/loci/formats/in/ZeissLSMReader.java

    r7227 r7260  
    364364    int seriesCount = 0; 
    365365 
     366    Vector<String> validFiles = new Vector<String>(); 
    366367    for (String filename : lsmFilenames) { 
    367       int extraSeries = getExtraSeries(filename); 
    368       seriesCounts.put(filename, extraSeries); 
    369       seriesCount += extraSeries; 
    370     } 
     368      try { 
     369        int extraSeries = getExtraSeries(filename); 
     370        seriesCounts.put(filename, extraSeries); 
     371        seriesCount += extraSeries; 
     372        validFiles.add(filename); 
     373      } 
     374      catch (IOException e) { 
     375        LOGGER.debug("Failed to parse " + filename, e); 
     376      } 
     377    } 
     378    lsmFilenames = validFiles.toArray(new String[validFiles.size()]); 
    371379 
    372380    core = new CoreMetadata[seriesCount]; 
     
    10151023            } 
    10161024          } 
    1017           else if (dataSize + in.getFilePointer() <= in.length()) { 
     1025          else if (dataSize + in.getFilePointer() <= in.length() && 
     1026            dataSize > 0) 
     1027          { 
    10181028            in.skipBytes(dataSize); 
    10191029          } 
Note: See TracChangeset for help on using the changeset viewer.