AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
February 2009

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



Thread

2009.02.12 20:12 "Accessing tif->tif_clientdata within my own error and warning functions", by Philip Watkinson
2009.02.13 08:13 "Re: Accessing tif->tif_clientdata within my own error andwarning functions", by Joris Van Damme
2009.02.17 16:17 "Re: Accessing tif->tif_clientdata within my own error andwarning functions", by Philip Watkinson
2009.02.17 17:04 "FW: Accessing tif->tif_clientdata within my own error andwarning functions", by Philip Watkinson
2009.02.17 18:24 "Re: FW: Accessing tif->tif_clientdata within my own error andwarning functions", by Bob Friesenhahn
2009.02.17 21:36 "Re: Accessing tif->tif_clientdata within my own error andwarning functions", by Joris Van Damme
2009.02.17 21:11 "Re: Accessing tif->tif_clientdata within my own errorandwarning functions", by Joris Van Damme

2009.02.17 21:11 "Re: Accessing tif->tif_clientdata within my own errorandwarning functions", by Joris Van Damme

Philip,

> Within TIFFWarning(), a warning extension function such as 
> TIFFWarningExt()
> can now be called. The first parameter in TIFFWarningExt() is a pointer to
> the client data. But when TIFFWarningExt() is called from within
> TIFFWarning(), a NULL(0) pointer is used for the client data because a
> pointer to TIFF is not passed to TIFFWarning(). How can I access the 
> client
> data (tif->tif_clientdata)?

The thing is, TIFFWarning() is there for backwards compatibility for people 
that placed extensions inside the LibTiff code, or brew their own subcodecs 
and such. We're likely overly cautious providing the backwards compatible 
warning raiser, likely only the backwards compatible warning handler is 
really used, but better safe then sorry. The core library, as distributed, 
does not ever call TIFFWarning(). Instead, it calls TIFFWarningExt() and 
provides the tif->tif_clientdata parameter.

If I remember correctly, there might be one or two exceptions inside library 
initialization code, where no TIFF or tif->tif_clientdata is present. So 
your handler should check and see if tif->tif_clientdata is NULL, and if it 
is, that means something vital went wrong in library initialization, 
independent of the encoding or decoding inside a specific TIFF context.


Best regards,

Joris