Changeset 4904


Ignore:
Timestamp:
03/11/09 11:42:47 (11 years ago)
Author:
melissa
Message:

OMETiffReader now checks for OME-XML in the TIFF comment, even if the extension is not '.ome.tiff' or '.ome.tif'. Closes #347.

File:
1 edited

Legend:

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

    r4858 r4904  
    5555  public OMETiffReader() { 
    5656    super("OME-TIFF", new String[] {"ome.tif", "ome.tiff"}); 
     57    suffixNecessary = false; 
     58    blockCheckLen = 1024 * 1024 * 5; 
    5759  } 
    5860 
     
    6163  /* @see loci.formats.IFormatReader#isThisType(RandomAccessStream) */ 
    6264  public boolean isThisType(RandomAccessStream stream) throws IOException { 
    63     return TiffTools.isValidHeader(stream); 
     65    boolean validHeader = TiffTools.isValidHeader(stream); 
     66    if (!validHeader) return false; 
     67    // look for OME-XML in first IFD's comment 
     68    Hashtable ifd = TiffTools.getFirstIFD(stream); 
     69    String comment = TiffTools.getComment(ifd); 
     70    if (comment == null) return false; 
     71    return comment.trim().endsWith("</OME>"); 
    6472  } 
    6573 
Note: See TracChangeset for help on using the changeset viewer.