2009.03.27 22:42 "[Tiff] TIFFOpen throws access error", by

2009.04.14 16:42 "Re: [Tiff] writing in-memory tiffs", by Bob Friesenhahn

I believe there are two bugs in tif_stream.cxx. For some reasons libtiff is try to seek before writing anything. This has two ramifications:

A seek followed by a write is commonly used to establish the file length, or sometimes just because it is possible. Operating systems arrange to "fill in the gap" via various approaches, which often result in zero-valued bytes. If the seek is past the current length, then it is reasonable to memset the difference with null bytes.

The newest beta of libtiff4 still doesn't work. The console output is as follows:

seek: 0
write: 8
seek: 0
error: Maximum TIFF file size exceeded

Note that libtiff4 uses 64-bit offsets and returns -1 cast to a 64-bit type to report errors for functions which return an offset or 64-bit size. Without great care this can cause problems.

Bob Friesenhahn
bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/