Changeset 6222


Ignore:
Timestamp:
05/03/10 17:27:58 (10 years ago)
Author:
melissa
Message:

Ported r6221 to 4.1 branch.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/4.1/components/bio-formats/src/loci/formats/in/NikonReader.java

    r5614 r6222  
    159159    IFD ifd = tp.getFirstIFD(); 
    160160    if (ifd == null) return false; 
    161     return ifd.containsKey(new Integer(TIFF_EPS_STANDARD)); 
     161    if (ifd.containsKey(new Integer(TIFF_EPS_STANDARD))) return true; 
     162    String make = ifd.getIFDTextValue(IFD.MAKE); 
     163    return make != null && make.indexOf("Nikon") != -1; 
    162164  } 
    163165 
     
    171173 
    172174    IFD ifd = ifds.get(no); 
    173  
    174     int dataSize = ifd.getBitsPerSample()[0]; 
     175    int[] bps = ifd.getBitsPerSample(); 
     176    int dataSize = bps[0]; 
    175177 
    176178    long[] byteCounts = ifd.getStripByteCounts(); 
     179    long totalBytes = 0; 
     180    for (long b : byteCounts) { 
     181      totalBytes += b; 
     182    } 
     183    if (totalBytes == FormatTools.getPlaneSize(this) || bps.length > 1) { 
     184      return super.openBytes(no, buf, x, y, w, h); 
     185    } 
     186 
    177187    long[] offsets = ifd.getStripOffsets(); 
    178188    long[] rowsPerStrip = ifd.getRowsPerStrip(); 
     
    449459 
    450460    core[0].imageCount = 1; 
     461    core[0].sizeT = 1; 
    451462    core[0].interleaved = true; 
    452463  } 
Note: See TracChangeset for help on using the changeset viewer.