Changeset 4209


Ignore:
Timestamp:
07/21/08 09:08:05 (12 years ago)
Author:
melissa
Message:
  • Check TIFF header starting from offset 0, not the current offset.
  • Don't assume that values in ImageJ-style TIFF comments will be integers.
Location:
trunk/loci/formats
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/formats/TiffTools.java

    r4205 r4209  
    269269 
    270270    // byte order must be II or MM 
     271    stream.seek(0); 
    271272    int endianOne = stream.read(); 
    272273    int endianTwo = stream.read(); 
  • trunk/loci/formats/in/TiffReader.java

    r4202 r4209  
    8080        int value = 0; 
    8181        if (token.indexOf("=") != -1) { 
    82           value = Integer.parseInt(token.substring(token.indexOf("=" + 1))); 
     82          try { 
     83            value = Integer.parseInt(token.substring(token.indexOf("=" + 1))); 
     84          } 
     85          catch (NumberFormatException e) { 
     86            if (debug) LogTools.trace(e); 
     87          } 
    8388        } 
    8489 
Note: See TracChangeset for help on using the changeset viewer.