2017.03.17 14:29 "[Tiff] TIFFSetErrorHandler vs TIFFSetErrorHandlerExt", by Dinesh Iyer

2017.03.17 14:53 "Re: [Tiff] TIFFSetErrorHandler vs TIFFSetErrorHandlerExt", by Bob Friesenhahn

Hi team,

I need to do some custom error handling which requires me to pass in the pointer to my class that is doing the TIFF I/O. I need this because I need to deliver warnings/errors to my application through a specific mechanism.

I noticed that TIFFSetErrorHandlerExt does allow me to pass that as the first argument. I was wondering if it is sufficient to set one of the error handlers or do I have to set both. The same applies for warning handlers as well.

These functions are redudant and both may be used at once. If TIFFSetErrorHandler() was used, then its error handler will be called. If TIFFSetErrorHandlerExt() was used, then its error handler will be called. They are called in succession.

This means that you can just use TIFFSetErrorHandlerExt() and be happy.

The main problem with these interfaces is that the internal storage location is shared across threads so threads can't use different handlers unless they serialize access to libtiff.

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