Changeset 3845


Ignore:
Timestamp:
03/25/08 10:06:23 (12 years ago)
Author:
melissa
Message:

Added warning comment to beginning of OME-XML block.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/formats/out/OMETiffWriter.java

    r3760 r3845  
    4040public class OMETiffWriter extends TiffWriter { 
    4141 
     42  // -- Constants -- 
     43 
     44  private static final String WARNING_COMMENT = 
     45    "<!-- Warning: this comment is an OME-XML metadata block, which " + 
     46    "contains crucial dimensional parameters and other important metadata. " + 
     47    "Please edit cautiously (if at all), and back up the original data " + 
     48    "before doing so.  For more information, see the OME-TIFF web site: " + 
     49    "http://loci.wisc.edu/ome/ome-tiff.html. -->"; 
     50 
    4251  // -- Fields -- 
    4352 
     
    6069      MetadataRetrieve retrieve = getMetadataRetrieve(); 
    6170      String xml = MetadataTools.getOMEXML(retrieve); 
     71 
     72      // insert warning comment 
     73 
     74      String prefix = xml.substring(0, xml.indexOf(">") + 1); 
     75      String suffix = xml.substring(xml.indexOf(">") + 1); 
     76      xml = prefix + WARNING_COMMENT + suffix; 
    6277 
    6378      int previousPixelsIndex = 0; 
     
    105120        } 
    106121 
    107         String prefix = xml.substring(0, end); 
    108         String suffix = xml.substring(end + len); 
     122        prefix = xml.substring(0, end); 
     123        suffix = xml.substring(end + len); 
    109124        xml = prefix + tiffData.toString() + suffix; 
    110125        previousPixelsIndex = pix + 8; 
Note: See TracChangeset for help on using the changeset viewer.