2009.02.12 20:12 "[Tiff] Accessing tif->tif_clientdata within my own error and warning functions", by Philip Watkinson

2009.02.17 18:24 "Re: [Tiff] FW: Accessing tif->tif_clientdata within my own error andwarning functions", by Bob Friesenhahn

Next question - It looks like the warning and error handling is not thread safe. I guess that I would have to add function pointers to TIFF?

Most thread APIs provide a means for thread-specific data. This includes both POSIX and Win32. Even if the thread API does not include interfaces for thread-specific data, it is easy to build one. You should be able to use thread-specific data in order to help make up for this design weakness in libtiff.

For an example "portable" TSD wrapper, see GraphicsMagick

http://cvs.graphicsmagick.org/cgi-bin/cvsweb.cgi/GraphicsMagick/magick/tsd.c

http://cvs.graphicsmagick.org/cgi-bin/cvsweb.cgi/GraphicsMagick/magick/tsd.h

and how it was used in the TIFF coder:

http://cvs.graphicsmagick.org/cgi-bin/cvsweb.cgi/GraphicsMagick/coders/tiff.c

Every application has different requirements. For GraphicsMagick, it is only necessary to capture the error info for when the call returns. Other applications may need to display an immediate dialog box.

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