Changeset 1911


Ignore:
Timestamp:
12/08/06 08:11:13 (13 years ago)
Author:
melissa
Message:

Fixed bug in image offset calculation.

Location:
trunk/loci/formats
Files:
2 edited

Legend:

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

    r1903 r1911  
    4141 
    4242  /** Debugging flag. */ 
    43   protected static final boolean DEBUG = true; 
     43  protected static final boolean DEBUG = false; 
    4444 
    4545  /** Debugging level. 1=basic, 2=extended, 3=everything. */ 
  • trunk/loci/formats/in/ZeissZVIReader.java

    r1904 r1911  
    368368      zSize = zIndices.size(); 
    369369      tSize = tIndices.size(); 
    370       nChannels *= cIndices.size(); 
     370      if (nChannels != cIndices.size()) nChannels *= cIndices.size(); 
    371371 
    372372      sizeX = new int[1]; 
     
    768768 
    769769          pt = oldPt + 4 + len; 
    770        
     770      
    771771          boolean foundWidth = DataTools.bytesToInt(data, pt, 4, true) == width; 
    772772          boolean foundHeight = 
    773773            DataTools.bytesToInt(data, pt + 4, 4, true) == height; 
     774          boolean findFailed = false; 
    774775          try { 
    775             while (!foundWidth || !foundHeight) { 
     776            while ((!foundWidth || !foundHeight) && pt < data.length) { 
    776777              pt++; 
    777778              foundWidth = DataTools.bytesToInt(data, pt, 4, true) == width; 
     
    782783          catch (Exception e) { }  
    783784          pt -= 8; 
     785          findFailed = !foundWidth && !foundHeight; 
    784786 
    785787          // image header and data 
     
    788790            (dirName.equals("Image") && numImageContainers == 0)) 
    789791          { 
    790             if (data.length - pt <= 0) pt = oldPt + 4 + len; 
     792            if (findFailed) pt = oldPt + 4 + len + 88; 
    791793            byte[] o = new byte[data.length - pt]; 
    792794            System.arraycopy(data, pt, o, 0, o.length); 
Note: See TracChangeset for help on using the changeset viewer.