Changeset 3264


Ignore:
Timestamp:
10/11/07 12:22:43 (12 years ago)
Author:
curtis
Message:

Use BYTES_PER_ENTRY instead of hardcoded 12 where relevant.

File:
1 edited

Legend:

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

    r3259 r3264  
    312312      in.seek(offset + // The beginning of the IFD 
    313313        2 + // The width of the initial numEntries field 
    314         (BYTES_PER_ENTRY * i)); 
     314        BYTES_PER_ENTRY * i); 
    315315 
    316316      int entryTag = in.readShort() & 0xffff; 
     
    385385 
    386386    for (int i=0; i<numEntries; i++) { 
    387       in.seek(offset + 2 + 12 * i); 
     387      in.seek(offset + 2 + BYTES_PER_ENTRY * i); 
    388388      int tag = in.readShort() & 0xffff; 
    389389      int type = in.readShort() & 0xffff; 
     
    560560      if (value != null) ifd.put(new Integer(tag), value); 
    561561    } 
    562     in.seek(offset + 2 + 12 * numEntries); 
     562    in.seek(offset + 2 + BYTES_PER_ENTRY * numEntries); 
    563563 
    564564    return ifd; 
     
    20332033      raf.seek(offset); 
    20342034      num = DataTools.read2UnsignedBytes(raf, little); 
    2035       if (i < ifd) raf.seek(offset + 2 + 12 * num); 
     2035      if (i < ifd) raf.seek(offset + 2 + BYTES_PER_ENTRY * num); 
    20362036    } 
    20372037 
     
    22502250    Object[] keys = ifd.keySet().toArray(); 
    22512251    Arrays.sort(keys); // sort IFD tags in ascending order 
    2252     int ifdBytes = 2 + 12 * keys.length + 4; 
     2252    int ifdBytes = 2 + BYTES_PER_ENTRY * keys.length + 4; 
    22532253    long pixelBytes = 0; 
    22542254    for (int i=0; i<stripsPerImage; i++) { 
Note: See TracChangeset for help on using the changeset viewer.