[Gdal-dev] BigTiff and libtiff

Andrey Kiselev dron at ak4719.spb.edu
Mon Sep 17 01:44:11 EDT 2007


On Sun, Sep 16, 2007 at 12:12:31AM -0400, Frank Warmerdam wrote:
> >It is not correct. Take a look at TIFFDirEntry structure in tiffiop.h,
> >it has 64-bit tdir_count field. There is a link to specification:
> >
> > http://www.awaresystems.be/imaging/tiff/bigtiff.html
> >
> >We certainly need large counts for strip/tile indexing, so it is.
> 
> Note that Garrett is talking about the number of directories, not the
> count of values in a tag which is what tdir_count is.

Er, right, I have misread it.

> I believe the directory index is a uint16 in the libtiff api
> (TIFFSetDirectory(), etc), but the file format just uses a chain of
> directions and has no explicit list on the number of directories, nor
> use of directory numbers or ids.
> 
> I still can't fathom why anyone would want more than 64K directories
> in a TIFF chain, but if so, I don't see why the libtiff api couldn't
> be changed to use at least "int" for this in libtiff4.

The maximum number of directories is only limited by the maximum
directory offset, so in theory we can have more than 2^32 IFDs in
BigTIFF. So it is better to go with uint64 instead of int.

Also the format does not use dirlist, but libtiff does and this change
should be carefully reviewed.

Garrett, please, create the bug report in libtiff's Bugzilla on this
issue.

Best regards,
Andrey

-- 
Andrey V. Kiselev
ICQ# 26871517



More information about the Gdal-dev mailing list