Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
Implementing TIFF Comments and Tags

The TIFF file formats support a number of comments that are saved and loaded using predefined tags. To specify the comments, tags set them directly in the image, every image has a Tags and Comments collection that allows you to add, remove, insert, clear, get and set. To read a comment from an existing file, you can use RasterCodecs.ReadComment method. To read a comment from a file at a specified location, use the version of RasterCodecs.ReadComment that takes a stream and offset. To write comments to an existing file, use RasterCodecs.WriteComments For a list of possible comments, refer to TIFF File Comments

Some restrictions apply if you use an Image File Directory (IFD) offset to indicate to which page to write a comment or tag. See the Loading And Saving Large TIFF Files topic for more information.

If the comments do not meet your needs, you can define your own tag for saving additional non-raster data in a TIFF file. For example, you may want to define a tag to save annotations.

The TIFF 6.0 Specification sets aside a range of private tags that developers can define. To avoid conflicts with files created by other developers, you can register your tag by contacting Adobe Developer Relations. (The E-Mail address posted on The Unofficial TIFF Home Page is gapdevsup@adobe.com.)

To load the tagged data from a file, you can use RasterCodecs.ReadTag method. To write tags to an existing file, or to change existing tags in a file, use RasterCodecs.WriteTag or RasterCodecs.WriteTags methods.

EnumTags enumerates all tags in a TIFF or Exif file. For each tag enumerated, the TagFound event is fired. Through this event, you can obtain information about, or otherwise process, each tag that is enumerated.

You can delete a specified tag from the file using DeleteTag.

The LEADTOOLS methods let you save one additional tag in a TIFF file. They are designed for future expansion to more than one tag.