2016.11.11 14:03 "[Tiff] Global variables in LibTIFF", by Paavo Helde

2016.11.11 14:39 "Re: [Tiff] Global variables in LibTIFF", by Bob Friesenhahn

I upgraded LibTIFF to current last stable version 4.0.6 and saw it still relies on global variables. In particular I am concerned about error and warning handlers. From tif_error.c:

The error/warning handlers are a known issue. Errors and warnings may occur when a TIFF is opened so the most appropriate solution would have been to allow the user to specify them as arguments to TIFFClientOpen(), TIFFOpen(), and other opening functions. This should have been done for the 4.0 release but the older interfaces would still have needed to remain in order to avoid needing to change existing valid source code.

It is likely that quite a lot of small changes would need to be made to libtiff in order to allow error/warning arguments to pass to the code which needs it.

Linking both shared and static libtiff to an application is a major no-no regardless of this issue. If you can't be sure of what storage will be used then you also can't be sure of which function implementations will be used.

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