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
August 2007

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

2007.08.09 12:07 "Error handling & threading", by John Aldridge
2007.08.09 14:30 "Re: Error handling & threading", by Frank Warmerdam
2007.08.10 10:50 "Re: Error handling & threading", by Joris Van Damme
2007.08.10 12:02 "Re: Error handling & threading", by John Aldridge

2007.08.09 14:30 "Re: Error handling & threading", by Frank Warmerdam

John Aldridge wrote:
> In a multi-threaded application, it can be a nuisance that the handlers 
> set by TIFFSetErrorHandler[Ext] & TIFFSetWarningHandler[Ext]  are static 
> variables.
> 
> Would there be any sympathy for adding a pair of such handler function 
> pointers to the TIFF structure? I suppose we'd need to add new versions 
> of the
> 
>   TIFFOpen, TIFFOpenW, TIFFFdOpen, TIFFClientOpen
> 
> functions which takes such function pointers as arguments and fill them 
> into the returned TIFF structure. The existing open functions could just 
> default them to the current TIFFErrorExt and TIFFWarningExt functions.
> 
> Then all calls to TIFFErrorExt and TIFFWarningExt in the library could 
> be replaced by one of
> 
>    tiff->tif_errorProc (...)
>    tiff->tif_warningProc (...)
> 
> These changes would allow applications to establish per-TIFF strcture 
> error policy without upsetting existing code.

John,

Adding new versions of the open functions isn't all that appealing, though
I *think* only a variation of TIFFClientOpen would be strictly required.
I do think this is a reasonable idea, but I am also concerned that some
TIFF errors may be issued from low levels where a TIFF structure is not
available.

Of course, it would also likely mean touching quite a bit of code...

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org