| AWARE [SYSTEMS] | Imaging expertise for the Delphi developer | |||||||
![]() |
TIFF and LibTiff Mailing List Archive | |||||||
LibTiff Mailing List
TIFF and LibTiff Mailing List Archive Contact
The TIFF Mailing List Homepage |
Thread2008.12.18 04:56 "tiffvers.h - TIFFLIB_RELEASE macro addition", by Frank WarmerdamFolks,
In ancient times, the only version information available to applications
building against libtiff was:
#define TIFFLIB_VERSION_STR "LIBTIFF, Version 4.0.0beta3\nCopyright (c)
1988-1996 Sam Leffler\nCopyright (c) 1991-1996 Silicon Graphics, Inc."
Circa 2000 or so I added:
/*
* This define can be used in code that requires
* compilation-related definitions specific to a
* version or versions of the library. Runtime
* version checking should be done based on the
* string returned by TIFFGetVersion.
*/
#define TIFFLIB_VERSION 20081217
in tiffvers.h. This is the date of release.
However, as we split the 3.9 and 4.0 branches a "time stamp" no longer
clearly defines the libtiff version well. So I propose to add:
/*
* This define contains the library version number encode as
* two digits each for major, minor and point. So, for instance,
* 3.9.8 would be 030908. This define was only introduced in libtiff4.
*/
#define TIFFLIB_RELEASE 040000
This macro should make it easy to do checks on features from different
versions of libtiff. An example (whether TIFFUnsetField() is available)
is demonstrated here:
#if TIFFLIB_VERSION >= 20081217 \
&& defined(TIFFLIB_RELEASE) && TIFFLIB_RELEASE >= 040000
TIFFUnsetField( poGDS->hTIFF, TIFFTAG_COLORMAP );
#else
CPLDebug( "GTiff",
"TIFFUnsetField() not supported, colormap may not be
cleared." );
#endif
Does the addition of TIFFLIB_RELEASE seem ok to folks? Any suggestions
or caveats? Hmm, I just discovered that tiffvers.h is autogenerated
by "make release" in the main libtiff makefile. Does anyone know why
such a mechanism is used? It seems like it might be rather involved to
cause it to generate the TIFFLIB_VERSION macro. I'm inclined to revert
this to a manual process described in HOWTO-RELEASE unless someone
sees a reason for it to be as complicated as it is now.
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 | Geospatial Programmer for Rent
|
|||||||