TIFF File Comments (original) (raw)
When reading or updating TIFF comments, you must specify the comment type using the following constants.
For TIFF files: Each comment field can contain a character string. The maximum field size is 32K, except for the date-time field, which are always 20.
Note that LEADTOOLS also supports IPTC Comments, which can be saved inside TIFF files. For more information, refer to IPTC Comments.
Initially, only TIFF files supported TIFF tags. But the TIFF tags are so flexible and well documented that other formats added mechanisms for including TIFF tags:
- CALS/TFX
- JPEG (through the APP1 Exif marker)
- HEIF/HEIC (through the Exif metadata)
- PNG (through the eXIf chunk)
As a result, the file formats listed above also support TIFF and Exif comments.
Value | Meaning |
---|---|
RasterCommentMetadataType.Artist | Person who created the image. |
RasterCommentMetadataType.Copyright | Copyright notice. |
RasterCommentMetadataType.DateTime | Date and time (YYYY:MM:DD HH:MM:SS). The field length is 20, counting the NULL terminator. |
RasterCommentMetadataType.Description | Description of the image. |
RasterCommentMetadataType.HostComputer | Computer and operating system in use. |
RasterCommentMetadataType.Make | Manufacturer of the equipment used to create the image. |
RasterCommentMetadataType.Model | Model name and number of the equipment. |
RasterCommentMetadataType.NameOfDocument | Name of the document from which the image was scanned. |
RasterCommentMetadataType.NameOfPage | Page name from which the image was scanned. |
RasterCommentMetadataType.Software | Name and version of the software package used to create the image. |
Note
If you are using the Nag version of Leadtools.dll, this comment is fixed and cannot be changed. | |
To obtain specified tagged data from a TIFF file or stream, use one of the RasterCodecs.ReadTag methods. To write or change a tag to an existing file, use one of the RasterCodecs.WriteTag or RasterCodecs.WriteTags methods.
For more information about file comments, refer to RasterCodecs.ReadComment and RasterCodecs.WriteComment.
For technical reasons, the following restrictions apply when you pass an IFD offset by setting the RasterCodecs.Options.Tiff.Load.ImageFileDirectoryOffset property if you set PageNumber to 1:
- You cannot add tags, comments or GeoKeys to this IFD. You can only update existing tags, comments or GeoKeys in this IFD.
- You cannot replace the TIFF page indicated by this IFD.
- You cannot add a page before this IFD.
- You cannot delete the page indicated by this IFD.
- You can, however, add tags, comments or GeoKeys to an IFD that follows the specified IFD (for example, if PageNumber is >= 2).
- You can also replace or delete a page that follows the specified IFD and you can insert a page after this IFD.