AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2009.03.27 22:42 "[Tiff] TIFFOpen throws access error", by
[...]
2009.04.07 13:44 "Re: [Tiff] Writing tiff to in-memory buffer", by Christian Henning
2009.04.06 15:35 "[Tiff] Writing tiff to in-memory buffer", by Christian Henning
2009.04.07 14:13 "Re: [Tiff] Writing tiff to in-memory buffer", by Edward Lam
2009.04.07 15:35 "Re: [Tiff] Writing tiff to in-memory buffer", by Bob Friesenhahn
2009.04.07 15:56 "Re: [Tiff] Writing tiff to in-memory buffer", by Christian Henning
2009.04.08 20:56 "[Tiff] writing in-memory tiffs", by Christian Henning
[...]

2009.04.07 15:35 "Re: [Tiff] Writing tiff to in-memory buffer", by Bob Friesenhahn

Ok, my read function was wrong. Since I only want to write into the buffer the read procedure should return 0 and not the size read. Fixing that gives me a valid TIFF*. I also need to setup my seek_proc to prohibit it from seeking on an empty ostream. Doing though would raise the failbit. I don't understand why TIFFClientOpen is calling seek_proc( 0,0). It seems redundant to me.

Without thoroughly analyzing the code, (and making a WAG) I get the impression that libtiff reads back the header it just wrote to obtain the actual endianness of the data and the TIFF subformat.

It is also true that a write stream should be flushed before depending on data being in the file.

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