Loading and Saving Large TIFF/BigTIFF Files

TIFF files are limited to 4GB. A newer version of this file format, BigTIFF, can create files larger than 4GB. In other aspects BigTIFF files are the same as TIFF files. For the rest of this topic, the generic term "TIFF file" will be used for both TIFF and BigTIFF files.

TIFF files can contain large numbers of pages. This can make loading and saving them very time-consuming.

The CodecsImageInfo class contains a Tiff.ImageFileDirectoryOffset (IFD) member that contains the offset of the desired page within the TIFF file.

To get the RasterCodecs.GetInformation method to use an IFD, set the RasterCodecs.Options.Tiff.Load.ImageFileDirectoryOffset value to the IFD and indicate within this class object that the IFD information is valid. Caution should be taken in using the IFD, since incorrect values could have unexpected consequences. Also note that the page numbering is different if the IFD is used: page 1 is the page whose IFD is indicated in the CodecsLoadOptions class object, page 2 is the page after the page whose IFD is indicated, etc.

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 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.

The CompactFile method lets you to convert between TIFF and BigTIFF files without recompressing the image data. It also lets you copy or extract one or more pages from a TIFF file and copy them without recompression to another TIFF file.

To determine whether a file is a TIFF file or a BigTIFF file, call the Leadtools.Codecs.CodecsTiffImageInfo.IsBigTiff property. If the file is a BigTiff file the call will return true; if the call returns false the file is a TIFF file.

To save a file as a BigTIFF file, set Leadtools.Codecs.CodecsTiffSaveOptions.BigTiff to true before saving. Saving a file with Leadtools.Codecs.CodecsTiffSaveOptions.BigTiff set to false results in the file being saved as a TIFF file. The default value is false (TIFF file format).

Help Version 20.0.2018.9.5
Products | Support | Contact Us | Copyright Notices
© 1991-2018 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Imaging, Medical, and Document