AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
September 2004

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



Thread

2004.09.13 11:15 "help needed - adding Annotated text", by Sonaye Chandan
2004.09.13 14:15 "Re: help needed - adding Annotated text", by Frank Warmerdam
2004.09.13 15:04 "Re: help needed - adding Annotated text", by Gerben Vos
2004.09.13 15:37 "Re: help needed - adding Annotated text", by Bob Friesenhahn
2004.09.13 15:56 "Re: help needed - adding Annotated text", by Jay Berkenbilt
2004.09.13 16:29 "Re: help needed - adding Annotated text", by Joris Van Damme
2004.09.13 18:41 "Re: help needed - adding Annotated text", by Richard Morris

2004.09.13 14:15 "Re: help needed - adding Annotated text", by Frank Warmerdam

sonaye chandan wrote:
> I need to add an annotated text to an TIFF image.
> The program will get the input like Path of the TIFF
> file, Text to be written, and where to write.
> 
> I can not use any ActiveX control as the code has to
> run on Solaris. How can I do this using libtiff? 

Chandan,

This *should* be as simple as:

...
#include <tiffio.h>
...

   TIFF *tif;

   tif = TIFFOpen( filename, "r+" );

   TIFFSetField( tif, TIFFTAG_IMAGEDESCRIPTION, text_to_write );

   TIFFRewriteDirectory(tiff);
   TIFFClose( tif );


This is similar to what the tiffset utility program does.  Note that each
call to TIFFRewriteDirectory() will duplicate the directory resulting in the
file growing by substantially more than the length of your image description
text.

I would also note that this sort of dynamic update should only be used with
relatively recent versions of libtiff.  3.6.0 or later should be fine.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent