Changeset 5131


Ignore:
Timestamp:
05/28/09 13:12:21 (11 years ago)
Author:
melissa
Message:

OMETiffWriter now writes a relative path name to UUID.FileName. OMETiffReader checks UUID.FileName more thoroughly - if it is an absolute path name which doesn't exist, then it is converted to a relative path name.

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

Legend:

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

    r5121 r5131  
    315315          } 
    316316 
     317          Location file = new Location(filename); 
     318          if (!file.exists()) { 
     319            // if this is an absolute file name, try using a relative name 
     320            // old versions of OMETiffWriter wrote an absolute path to 
     321            // UUID.FileName, which causes problems if the file is moved to 
     322            // a different directory 
     323            filename = 
     324              filename.substring(filename.lastIndexOf(File.separator) + 1); 
     325            filename = dir + File.separator + filename; 
     326          } 
     327 
    317328          // populate plane index -> IFD mapping 
    318329          for (int q=0; q<count; q++) { 
  • trunk/components/bio-formats/src/loci/formats/out/OMETiffWriter.java

    r5093 r5131  
    2424package loci.formats.out; 
    2525 
     26import java.io.File; 
    2627import java.io.IOException; 
    2728import java.util.Vector; 
     
    124125          int[] zct = FormatTools.getZCTCoords(dimensionOrder, 
    125126            sizeZ, sizeC, sizeT, imageCount, plane); 
    126           omeMeta.setTiffDataFileName(currentId, series, 0, plane); 
     127 
     128          // use the relative file path 
     129          String filename = 
     130            currentId.substring(currentId.lastIndexOf(File.separator) + 1); 
     131 
     132          omeMeta.setTiffDataFileName(filename, series, 0, plane); 
    127133          omeMeta.setTiffDataFirstZ(new Integer(zct[0]), series, 0, plane); 
    128134          omeMeta.setTiffDataFirstC(new Integer(zct[1]), series, 0, plane); 
Note: See TracChangeset for help on using the changeset viewer.