Changeset 974


Ignore:
Timestamp:
05/18/06 15:13:45 (14 years ago)
Author:
curtis
Message:

Use new TiffTools getIFDs RandomAccessStream.

Location:
trunk/utils
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/utils/EditOMETIFF.java

    r953 r974  
    2323      String nf = "new-" + f; 
    2424      System.out.print("Reading " + f + " "); 
    25       DataInputStream fin = new DataInputStream(new FileInputStream(f)); 
    26       Hashtable[] ifds = TiffTools.getIFDs(fin); 
     25      RandomAccessStream fin = new RandomAccessStream(f); 
     26      Hashtable ifd = TiffTools.getFirstIFD(fin); 
    2727      fin.close(); 
    2828      String ome = (String) 
    29         TiffTools.getIFDValue(ifds[0], TiffTools.IMAGE_DESCRIPTION); 
     29        TiffTools.getIFDValue(ifd, TiffTools.IMAGE_DESCRIPTION); 
    3030      System.out.println("[done]"); 
    3131      System.out.println("OME-XML block ="); 
     
    3939        BufferedImage img = opener.openImage(f, j); 
    4040 
    41         Hashtable ifd = new Hashtable(); 
     41        ifd = new Hashtable(); 
    4242        if (j == 0) { 
    4343          // update OME-XML block 
  • trunk/utils/TiffComment.java

    r953 r974  
    33// 
    44 
    5 import java.io.DataInputStream; 
    6 import java.io.FileInputStream; 
     5import loci.formats.RandomAccessStream; 
    76import loci.formats.TiffTools; 
    87import java.util.Hashtable; 
     
    1817    for (int i=0; i<args.length; i++) { 
    1918      // read IFDs 
    20       DataInputStream in = new DataInputStream(new FileInputStream(args[i])); 
    21       Hashtable[] ifds = TiffTools.getIFDs(in); 
     19      RandomAccessStream in = new RandomAccessStream(args[i]); 
     20      Hashtable ifd = TiffTools.getFirstIFD(in); 
    2221      in.close(); 
    2322 
    2423      // extract comment 
    25       Object o = TiffTools.getIFDValue(ifds[0], TiffTools.IMAGE_DESCRIPTION); 
     24      Object o = TiffTools.getIFDValue(ifd, TiffTools.IMAGE_DESCRIPTION); 
    2625      String comment = null; 
    2726      if (o instanceof String) comment = (String) o; 
Note: See TracChangeset for help on using the changeset viewer.