Changeset 5693 for branches/4.1


Ignore:
Timestamp:
11/16/09 11:46:55 (11 years ago)
Author:
melissa
Message:
  • Throw a more informative exception if an invalid file pattern is passed to FileStitcher.
  • If the user specifies an invalid file pattern in the ImageJ plugin, default to using the original file name.
Location:
branches/4.1/components
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.1/components/bio-formats/src/loci/formats/FileStitcher.java

    r5664 r5693  
    925925    fp = findPattern(currentId); 
    926926 
    927     if (reader.fileGroupOption(id) == FormatTools.MUST_GROUP) { 
     927    if (reader.fileGroupOption(id) == FormatTools.MUST_GROUP && !patternIds) { 
    928928      // reader subclass is handling file grouping 
    929929      noStitch = true; 
    930930      reader.setId(currentId); 
    931931      return; 
     932    } 
     933 
     934    if (!fp.isValid()) { 
     935      throw new FormatException("Invalid file pattern: " + fp.getPattern()); 
    932936    } 
    933937    reader.setId(fp.getFiles()[0]); 
  • branches/4.1/components/loci-plugins/src/loci/plugins/importer/Importer.java

    r5557 r5693  
    279279        id = options.getId(); 
    280280        if (id == null) id = currentFile; 
     281        FilePattern fp = new FilePattern(id); 
     282        if (!fp.isValid()) { 
     283          id = currentFile; 
     284        } 
    281285      } 
    282286      else debug("no need to prompt for file pattern"); 
     
    611615          int merge = (needComposite || !doMerge) ? 1 : cSize; 
    612616 
     617          r.setSeries(i); 
    613618          // NB: ImageJ 1.39+ is required for VirtualStack 
    614619          BFVirtualStack virtualStackB = new BFVirtualStack(id, 
Note: See TracChangeset for help on using the changeset viewer.