Changeset 2503


Ignore:
Timestamp:
03/23/07 08:29:48 (13 years ago)
Author:
melissa
Message:
  • Fixed NPE while checking for MetaMorph comment.
  • Fixed bug with TIFF file that is defined as grayscale, but is actually RGB.
Location:
trunk/loci/formats/in
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/formats/in/BaseTiffReader.java

    r2478 r2503  
    702702  public boolean isInterleaved(String id) throws FormatException, IOException { 
    703703    if (!id.equals(currentId)) initFile(id); 
    704     int pi = TiffTools.getPhotometricInterpretation(ifds[0]); 
    705     return pi == TiffTools.RGB || pi == TiffTools.RGB_PALETTE || 
    706       pi == TiffTools.CFA_ARRAY; 
     704    return TiffTools.getSamplesPerPixel(ifds[0]) > 1;  
    707705  } 
    708706 
  • trunk/loci/formats/in/TiffReader.java

    r2495 r2503  
    162162          orderCertain[i] = true; 
    163163 
     164          /* debug */ System.out.println("Z=" + sizeZ[i] + ", C=" + sc + 
     165            ", T=" + sizeT[i]); 
    164166          boolean[][][] zct = new boolean[sizeZ[i]][sc][sizeT[i]]; 
    165167 
     
    182184              (nullIfd ? numImages : 1) : Integer.parseInt(aNumPlanes); 
    183185 
     186            /* debug */ System.out.println("first (" + firstZ + "," + firstC + 
     187              "," + firstT + ")"); 
     188 
    184189            // populate ZCT matrix 
    185190            char d1st = currentOrder[i].charAt(2); 
    186191            char d2nd = currentOrder[i].charAt(3); 
    187192            int z = firstZ, t = firstT, c = firstC; 
     193             
     194            /* debug */ System.out.println("number of planes : " + numPlanes);  
     195             
    188196            for (int k=0; k<numPlanes; k++) { 
     197              /* debug */ System.out.println("z=" + z + ", c=" + c + ", t=" + t); 
    189198              zct[z][c][t] = true; 
    190199              switch (d1st) { 
     
    464473   
    465474    // check for MetaMorph-style TIFF comment  
    466     boolean metamorph = comment != null &&  
     475    boolean metamorph = comment != null && getMeta("Software") != null &&  
    467476      ((String) getMeta("Software")).indexOf("MetaMorph") != -1;  
    468477    put("MetaMorph", metamorph ? "yes" : "no");  
Note: See TracChangeset for help on using the changeset viewer.