2000.03.13 14:11 "TIFF image file size", by Bruce Cameron

2000.03.13 10:46 "Re: TIFF image file size", by Frank Warmerdam

A colleague has the following error when animage processing program [OrthoBase] finishes and writes a TIFF image file --

                Error writing data for field "BitsPerSample"

Now this is a very large file [over 3 Gbytes], and OrthoBase says it is because

"The TIFF header limits size to 32 bits (2Gig) (pixels or bytes - I'd have to check) even if file system supports larger files."

I am not aware of a size limit, and even if it were the actual error makes no sense - the BitsPerSample tag is a UINT16 but actual values in that field should in no way get that big.

Comments on file size limits and the meaning of that error are solicited.


The most recent release version of libtiff (which this application may be using) uses signed integers for file offset, and this implicitly limits seeks to be within the first 2GB. I presume the application has successfully written the image data beyond the 2GB limit (because no seeks are required) but when it tries to write the directory while closing the file a seek is done and this fail. I suspect BitsPerSample is just the first tag that it tries to write to the directory.

The current CVS source contains patches to use unsigned offsets for file positions, and allows writing and reading up to 4GB files successfully. Because TIFF itself uses 32bit offsets in the format, it is not possible to go beyond 4GB without changing the format, or making some really funky assumptions.

Best regards,

I set the clouds in motion - turn up   | Frank Warmerdam, warmerda@home.com
light and sound - activate the windows | http://members.home.com/warmerda
and watch the world go round - Rush    | Geospatial Programmer for Rent