Changeset 4078


Ignore:
Timestamp:
05/30/08 08:22:44 (12 years ago)
Author:
curtis
Message:

Use TiffTools.getComment (but leave IFD entry approach commented out).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/utils/EditTiff.java

    r3456 r4078  
    1919    for (int i=0; i<args.length; i++) { 
    2020      String f = args[i]; 
    21       // read first IFD 
     21      // read comment 
    2222      System.out.println("Reading " + f + " "); 
    23       RandomAccessStream fin = new RandomAccessStream(f); 
    24       Hashtable ifd = TiffTools.getFirstIFD(fin); 
    25       fin.close(); 
    26       if (ifd == null) System.out.println("Warning: first IFD is null!"); 
    27       // extract TIFF comment from IFD 
    28       String ome = TiffTools.getComment(ifd); 
     23      String comment = TiffTools.getComment(f); 
     24      // or if you already have the file open for random access, you can use: 
     25      // RandomAccessStream fin = new RandomAccessStream(f); 
     26      // Hashtable ifd = TiffTools.getFirstIFD(fin); 
     27      // String comment = (String) 
     28      //   TiffTools.getIFDValue(ifd, TiffTools.IMAGE_DESCRIPTION); 
     29      // fin.close(); 
    2930      System.out.println("[done]"); 
    3031      // display comment, and prompt for changes 
    3132      System.out.println("Comment ="); 
    32       System.out.println(ome); 
     33      System.out.println(comment); 
    3334      System.out.println("Enter new comment (no line breaks):"); 
    3435      String xml = cin.readLine(); 
Note: See TracChangeset for help on using the changeset viewer.