Changeset 7208


Ignore:
Timestamp:
11/15/10 16:48:01 (10 years ago)
Author:
melissa
Message:

Backported r7207 to 4.2.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/4.2/components/bio-formats/src/loci/formats/in/MetamorphReader.java

    r7178 r7208  
    748748    int rgbChannels = getSizeC(); 
    749749 
     750    // Now that the base TIFF standard metadata has been parsed, we need to 
     751    // parse out the STK metadata from the UIC4TAG. 
     752 
     753    TiffIFDEntry uic1tagEntry = null; 
     754    TiffIFDEntry uic2tagEntry = null; 
     755    TiffIFDEntry uic4tagEntry = null; 
     756 
    750757    try { 
    751       // Now that the base TIFF standard metadata has been parsed, we need to 
    752       // parse out the STK metadata from the UIC4TAG. 
    753       TiffIFDEntry uic1tagEntry = tiffParser.getFirstIFDEntry(UIC1TAG); 
    754       TiffIFDEntry uic2tagEntry = tiffParser.getFirstIFDEntry(UIC2TAG); 
    755       TiffIFDEntry uic4tagEntry = tiffParser.getFirstIFDEntry(UIC4TAG); 
    756       mmPlanes = uic4tagEntry.getValueCount(); 
    757       parseUIC2Tags(uic2tagEntry.getValueOffset()); 
    758       if (getMetadataOptions().getMetadataLevel() != MetadataLevel.MINIMUM) { 
    759         parseUIC4Tags(uic4tagEntry.getValueOffset()); 
    760         parseUIC1Tags(uic1tagEntry.getValueOffset(), 
    761           uic1tagEntry.getValueCount()); 
    762       } 
    763       in.seek(uic4tagEntry.getValueOffset()); 
     758      uic1tagEntry = tiffParser.getFirstIFDEntry(UIC1TAG); 
     759      uic2tagEntry = tiffParser.getFirstIFDEntry(UIC2TAG); 
     760      uic4tagEntry = tiffParser.getFirstIFDEntry(UIC4TAG); 
    764761    } 
    765762    catch (IllegalArgumentException exc) { 
    766763      LOGGER.debug("Unknown tag", exc); 
     764    } 
     765 
     766    try { 
     767      if (uic4tagEntry != null) { 
     768        mmPlanes = uic4tagEntry.getValueCount(); 
     769      } 
     770      if (uic2tagEntry != null) { 
     771        parseUIC2Tags(uic2tagEntry.getValueOffset()); 
     772      } 
     773      if (getMetadataOptions().getMetadataLevel() != MetadataLevel.MINIMUM) { 
     774        if (uic4tagEntry != null) { 
     775          parseUIC4Tags(uic4tagEntry.getValueOffset()); 
     776        } 
     777        if (uic1tagEntry != null) { 
     778          parseUIC1Tags(uic1tagEntry.getValueOffset(), 
     779            uic1tagEntry.getValueCount()); 
     780        } 
     781      } 
     782      in.seek(uic4tagEntry.getValueOffset()); 
    767783    } 
    768784    catch (NullPointerException exc) { 
Note: See TracChangeset for help on using the changeset viewer.