[Gdal-dev] BigTiff and libtiff

Frank Warmerdam warmerdam at pobox.com
Sun Sep 16 00:12:31 EDT 2007


Andrey Kiselev wrote:
> On Fri, Sep 14, 2007 at 02:03:08PM -0400, Garrett Potts wrote:
>> I have been looking through the headers on BigTiff and was looking at
>> the bit size for the number of directories.  Looks like the directory
>> count can only support 16bit word which puts it at a limitation of
>> 65536 total.  Is this correct?
> 
> 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.

Andrey,

Note that Garrett is talking about the number of directories, not the
count of values in a tag which is what tdir_count is.

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.

In any event, bug reports or patches should be reported via the libtiff
bugzilla and further discussion ought to be on the tiff list.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org




More information about the Gdal-dev mailing list