本文整理汇总了C++中TIFFGetVersion函数的典型用法代码示例。如果您正苦于以下问题:C++ TIFFGetVersion函数的具体用法?C++ TIFFGetVersion怎么用?C++ TIFFGetVersion使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了TIFFGetVersion函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int
main(int argc, char* argv[])
{
TIFF *in, *out;
if (argc < 2) {
fprintf(stderr, "%s\n\n", TIFFGetVersion());
fprintf(stderr, "usage: tiffsplit input.tif [prefix]\n");
return (-3);
}
if (argc > 2)
strcpy(fname, argv[2]);
in = TIFFOpen(argv[1], "r");
if (in != NULL) {
do {
char path[1024+1];
newfilename();
strcpy(path, fname);
strcat(path, ".tif");
out = TIFFOpen(path, TIFFIsBigEndian(in)?"wb":"wl");
if (out == NULL)
return (-2);
if (!tiffcp(in, out))
return (-1);
TIFFClose(out);
} while (TIFFReadDirectory(in));
(void) TIFFClose(in);
}
return (0);
}
示例2: tiffcvt
static int
tiffcvt(TIFF* in, TIFF* out)
{
uint32 width, height; /* image width & height */
uint32* raster; /* retrieve RGBA image */
uint16 shortv;
float floatv;
char *stringv;
uint32 longv;
TIFFGetField(in, TIFFTAG_IMAGEWIDTH, &width);
TIFFGetField(in, TIFFTAG_IMAGELENGTH, &height);
raster = (uint32*)_TIFFmalloc(width * height * sizeof (uint32));
if (raster == 0) {
TIFFError(TIFFFileName(in), "No space for raster buffer");
return (0);
}
if (!TIFFReadRGBAImage(in, width, height, raster, 0)) {
_TIFFfree(raster);
return (0);
}
CopyField(TIFFTAG_SUBFILETYPE, longv);
TIFFSetField(out, TIFFTAG_IMAGEWIDTH, width);
TIFFSetField(out, TIFFTAG_IMAGELENGTH, height);
TIFFSetField(out, TIFFTAG_BITSPERSAMPLE, 8);
TIFFSetField(out, TIFFTAG_COMPRESSION, compression);
TIFFSetField(out, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_YCBCR);
if (compression == COMPRESSION_JPEG)
TIFFSetField(out, TIFFTAG_JPEGCOLORMODE, JPEGCOLORMODE_RAW);
CopyField(TIFFTAG_FILLORDER, shortv);
TIFFSetField(out, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT);
TIFFSetField(out, TIFFTAG_SAMPLESPERPIXEL, 3);
CopyField(TIFFTAG_XRESOLUTION, floatv);
CopyField(TIFFTAG_YRESOLUTION, floatv);
CopyField(TIFFTAG_RESOLUTIONUNIT, shortv);
TIFFSetField(out, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
{ char buf[2048];
char *cp = strrchr(TIFFFileName(in), '/');
sprintf(buf, "YCbCr conversion of %s", cp ? cp+1 : TIFFFileName(in));
TIFFSetField(out, TIFFTAG_IMAGEDESCRIPTION, buf);
}
TIFFSetField(out, TIFFTAG_SOFTWARE, TIFFGetVersion());
CopyField(TIFFTAG_DOCUMENTNAME, stringv);
TIFFSetField(out, TIFFTAG_REFERENCEBLACKWHITE, refBlackWhite);
TIFFSetField(out, TIFFTAG_YCBCRSUBSAMPLING,
horizSubSampling, vertSubSampling);
TIFFSetField(out, TIFFTAG_YCBCRPOSITIONING, YCBCRPOSITION_CENTERED);
TIFFSetField(out, TIFFTAG_YCBCRCOEFFICIENTS, ycbcrCoeffs);
rowsperstrip = TIFFDefaultStripSize(out, rowsperstrip);
TIFFSetField(out, TIFFTAG_ROWSPERSTRIP, rowsperstrip);
return (cvtRaster(out, raster, width, height));
}
示例3: usage
static void
usage(void)
{
char buf[BUFSIZ];
int i;
setbuf(stderr, buf);
fprintf(stderr, "%s\n\n", TIFFGetVersion());
for (i = 0; stuff[i] != NULL; i++)
fprintf(stderr, "%s\n", stuff[i]);
exit(-1);
}
示例4: help
/** help function */
void help () {
printf ("fixit_tiff\n");
printf ("uses libtiff version %s\n", TIFFGetVersion());
printf ("call it with:\n");
printf ("\tfixit_tiff [-h|-c|-s|-b] -i <infile> [-o <outfile>]\n");
printf ("\nwhere <infile> is the possibly broken file\n");
printf ("and <outfile> is the name of the corrected file\n");
printf ("\t-c checks file only\n");
printf ("\t-s inplace file substitution (only -i needed, dangerous)\n");
printf ("\t-b clean up (eliminates tags to be baseline tiff conform)\n");
printf ("\t-q disables describing messages\n");
printf ("\t-t try to fix tagorder (dangerous)\n");
printf ("\tHint: 'fixit_tiff -i <infile> -o <outfile>' repairs date only\n");
}
示例5: tiffcvt
static int
tiffcvt(TIFF* in, TIFF* out)
{
uint32 width, height; /* image width & height */
uint16 shortv;
float floatv;
char *stringv;
uint32 longv;
uint16 v[1];
TIFFGetField(in, TIFFTAG_IMAGEWIDTH, &width);
TIFFGetField(in, TIFFTAG_IMAGELENGTH, &height);
CopyField(TIFFTAG_SUBFILETYPE, longv);
TIFFSetField(out, TIFFTAG_IMAGEWIDTH, width);
TIFFSetField(out, TIFFTAG_IMAGELENGTH, height);
TIFFSetField(out, TIFFTAG_BITSPERSAMPLE, 8);
TIFFSetField(out, TIFFTAG_COMPRESSION, compression);
TIFFSetField(out, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_RGB);
CopyField(TIFFTAG_FILLORDER, shortv);
TIFFSetField(out, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT);
if( no_alpha )
TIFFSetField(out, TIFFTAG_SAMPLESPERPIXEL, 3);
else
TIFFSetField(out, TIFFTAG_SAMPLESPERPIXEL, 4);
if( !no_alpha )
{
v[0] = EXTRASAMPLE_ASSOCALPHA;
TIFFSetField(out, TIFFTAG_EXTRASAMPLES, 1, v);
}
CopyField(TIFFTAG_XRESOLUTION, floatv);
CopyField(TIFFTAG_YRESOLUTION, floatv);
CopyField(TIFFTAG_RESOLUTIONUNIT, shortv);
TIFFSetField(out, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
TIFFSetField(out, TIFFTAG_SOFTWARE, TIFFGetVersion());
CopyField(TIFFTAG_DOCUMENTNAME, stringv);
if( process_by_block && TIFFIsTiled( in ) )
return( cvt_by_tile( in, out ) );
else if( process_by_block )
return( cvt_by_strip( in, out ) );
else
return( cvt_whole_image( in, out ) );
}
示例6: libtiff_version
/**
* Libtiff version
*/
static PyObject* libtiff_version() {
static const std::string beg_str("LIBTIFF, Version ");
static const size_t beg_len = beg_str.size();
std::string vtiff(TIFFGetVersion());
// Remove first part if it starts with "LIBTIFF, Version "
if(vtiff.compare(0, beg_len, beg_str) == 0)
vtiff = vtiff.substr(beg_len);
// Remove multiple (copyright) lines if any
size_t end_line = vtiff.find("\n");
if(end_line != std::string::npos)
vtiff = vtiff.substr(0,end_line);
return Py_BuildValue("s", vtiff.c_str());
}
示例7: PrintVersion
void PrintVersion(int mode=0)
{
cout << LISA_VERSION << endl;
if (mode) {
cout << "compiled ";
#ifdef __GNUC__
cout << "with GNU " << __VERSION__;
#endif
#if __x86_64__
cout << " (64-bit)";
#else
cout << " (32-bit)";
#endif
cout << " on " << __DATE__ << endl;
}
#ifdef TIFF_SUPPORT
cout << endl << TIFFGetVersion() << endl;
#endif
}
示例8: usage
static void
usage(void)
{
char buf[BUFSIZ];
int i;
setbuf(stderr, buf);
fprintf(stderr, "%s\n\n", TIFFGetVersion());
#if defined(__INTEL_COMPILER) && 1 /* VDM auto patch */
# pragma ivdep
# pragma swp
# pragma unroll
# pragma prefetch
# if 0
# pragma simd noassert
# endif
#endif /* VDM auto patch */
for (i = 0; stuff[i] != NULL; i++)
fprintf(stderr, "%s\n", stuff[i]);
exit(-1);
}
示例9: main
int
main(int argc, char* argv[])
{
TIFF *in, *out;
if (argc < 2) {
fprintf(stderr, "%s\n\n", TIFFGetVersion());
fprintf(stderr, "usage: tiffsplit input.tif [prefix]\n");
return (-3);
}
if (argc > 2) {
strncpy(fname, argv[2], sizeof(fname));
fname[sizeof(fname) - 1] = '\0';
}
in = TIFFOpen(argv[1], "r");
if (in != NULL) {
do {
size_t path_len;
char *path;
newfilename();
path_len = strlen(fname) + sizeof(TIFF_SUFFIX);
path = (char *) _TIFFmalloc(path_len);
strncpy(path, fname, path_len);
path[path_len - 1] = '\0';
strncat(path, TIFF_SUFFIX, path_len - strlen(path) - 1);
out = TIFFOpen(path, TIFFIsBigEndian(in)?"wb":"wl");
_TIFFfree(path);
if (out == NULL)
return (-2);
if (!tiffcp(in, out))
return (-1);
TIFFClose(out);
} while (TIFFReadDirectory(in));
(void) TIFFClose(in);
}
return (0);
}
示例10: tiff_check_version
static gboolean
tiff_check_version(gint required_macro, gint required_micro, GError **error)
{
gchar *version = g_strdup(TIFFGetVersion());
gchar *ptr;
gboolean result = TRUE;
gint major;
gint minor;
gint micro;
ptr = strchr(version, '\n');
if (ptr)
*ptr = '\0';
ptr = version;
while (*ptr && !g_ascii_isdigit(*ptr))
ptr++;
if (sscanf(ptr, "%d.%d.%d", &major, &minor, µ) != 3) {
g_warning("Cannot parse TIFF version, proceed with fingers crossed");
}
else if ((major < required_macro)
|| (major == required_macro && minor < required_micro)) {
result = FALSE;
g_set_error(error, GWY_MODULE_FILE_ERROR,
GWY_MODULE_FILE_ERROR_SPECIFIC,
_("LibTIFF too old!\n\n"
"You are using %s. Please update to "
"libtiff version %d.%d or newer."), version,
required_macro, required_micro);
}
g_free(version);
return result;
}
示例11: tiffcvt
static int
tiffcvt(TIFF* in, TIFF* out)
{
uint32 width, height; /* image width & height */
uint32* raster; /* retrieve RGBA image */
uint16 shortv;
float floatv;
char *stringv;
uint32 longv;
size_t pixel_count;
TIFFGetField(in, TIFFTAG_IMAGEWIDTH, &width);
TIFFGetField(in, TIFFTAG_IMAGELENGTH, &height);
pixel_count = width * height;
/* XXX: Check the integer overflow. */
if (!width || !height || pixel_count / width != height) {
TIFFError(TIFFFileName(in),
"Malformed input file; "
"can't allocate buffer for raster of %lux%lu size",
(unsigned long)width, (unsigned long)height);
return 0;
}
raster = (uint32*)_TIFFCheckMalloc(in, pixel_count, sizeof(uint32),
"raster buffer");
if (raster == 0) {
TIFFError(TIFFFileName(in),
"Requested buffer size is %lu elements %lu each",
(unsigned long)pixel_count,
(unsigned long)sizeof(uint32));
return (0);
}
if (!TIFFReadRGBAImage(in, width, height, raster, 0)) {
_TIFFfree(raster);
return (0);
}
CopyField(TIFFTAG_SUBFILETYPE, longv);
TIFFSetField(out, TIFFTAG_IMAGEWIDTH, width);
TIFFSetField(out, TIFFTAG_IMAGELENGTH, height);
TIFFSetField(out, TIFFTAG_BITSPERSAMPLE, 8);
TIFFSetField(out, TIFFTAG_COMPRESSION, compression);
TIFFSetField(out, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_YCBCR);
if (compression == COMPRESSION_JPEG)
TIFFSetField(out, TIFFTAG_JPEGCOLORMODE, JPEGCOLORMODE_RAW);
CopyField(TIFFTAG_FILLORDER, shortv);
TIFFSetField(out, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT);
TIFFSetField(out, TIFFTAG_SAMPLESPERPIXEL, 3);
CopyField(TIFFTAG_XRESOLUTION, floatv);
CopyField(TIFFTAG_YRESOLUTION, floatv);
CopyField(TIFFTAG_RESOLUTIONUNIT, shortv);
TIFFSetField(out, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
{ char buf[2048];
char *cp = strrchr(TIFFFileName(in), '/');
sprintf(buf, "YCbCr conversion of %s", cp ? cp+1 : TIFFFileName(in));
TIFFSetField(out, TIFFTAG_IMAGEDESCRIPTION, buf);
}
TIFFSetField(out, TIFFTAG_SOFTWARE, TIFFGetVersion());
CopyField(TIFFTAG_DOCUMENTNAME, stringv);
TIFFSetField(out, TIFFTAG_REFERENCEBLACKWHITE, refBlackWhite);
TIFFSetField(out, TIFFTAG_YCBCRSUBSAMPLING,
horizSubSampling, vertSubSampling);
TIFFSetField(out, TIFFTAG_YCBCRPOSITIONING, YCBCRPOSITION_CENTERED);
TIFFSetField(out, TIFFTAG_YCBCRCOEFFICIENTS, ycbcrCoeffs);
rowsperstrip = TIFFDefaultStripSize(out, rowsperstrip);
TIFFSetField(out, TIFFTAG_ROWSPERSTRIP, rowsperstrip);
return (cvtRaster(out, raster, width, height));
}
示例12: PictureToTif
/*
*---------------------------------------------------------------------------
*
* PictureToTif --
*
* Writes a TIFF format image to the provided data buffer.
*
* Results:
* A standard TCL result. If an error occured, TCL_ERROR is
* returned and an error message will be place in the interpreter
* result. Otherwise, the data sink will contain the binary
* output of the image.
*
* Side Effects:
* Memory is allocated for the data sink.
*
*---------------------------------------------------------------------------
*/
static int
PictureToTif(Tcl_Interp *interp, Blt_Picture picture, Blt_DBuffer dbuffer,
TifExportSwitches *switchesPtr)
{
TIFF *tifPtr;
TIFFErrorHandler oldErrorHandler, oldWarningHandler;
TifMessage message;
int photometric, samplesPerPixel;
int compress, result, nColors;
Picture *srcPtr;
compress = tifCompressionSchemes[switchesPtr->compress];
if (compress == COMPRESSION_NONE) {
fprintf(stderr, "not compressing TIFF output\n");
}
#ifdef notdef
if (!TIFFIsCODECConfigured((unsigned short int)compress)) {
compress = COMPRESSION_NONE;
}
#endif
srcPtr = picture;
Tcl_DStringInit(&message.errors);
Tcl_DStringInit(&message.warnings);
Tcl_DStringAppend(&message.errors, "error writing TIF output: ", -1);
tifMessagePtr = &message;
message.nErrors = message.nWarnings = 0;
oldErrorHandler = TIFFSetErrorHandler(TifError);
oldWarningHandler = TIFFSetWarningHandler(TifWarning);
tifPtr = TIFFClientOpen("data buffer", "w", (thandle_t)dbuffer,
TifRead, /* TIFFReadWriteProc */
TifWrite, /* TIFFReadWriteProc */
TifSeek, /* TIFFSeekProc */
TifClose, /* TIFFCloseProc */
TifSize, /* TIFFSizeProc */
TifMapFile, /* TIFFMapFileProc */
TifUnmapFile); /* TIFFUnmapFileProc */
if (tifPtr == NULL) {
Tcl_AppendResult(interp, "can't register TIF procs: ", (char *)NULL);
return TCL_ERROR;
}
nColors = Blt_QueryColors(srcPtr, (Blt_HashTable *)NULL);
if (Blt_PictureIsColor(srcPtr)) {
samplesPerPixel = (Blt_PictureIsOpaque(srcPtr)) ? 3 : 4;
photometric = PHOTOMETRIC_RGB;
} else {
if (!Blt_PictureIsOpaque(srcPtr)) {
Blt_Picture background;
Blt_Pixel white;
/* Blend picture with solid color background. */
background = Blt_CreatePicture(srcPtr->width, srcPtr->height);
white.u32 = 0xFFFFFFFF;
Blt_BlankPicture(background, &white); /* White background. */
Blt_BlendPictures(background, srcPtr, 0, 0, srcPtr->width,
srcPtr->height, 0, 0);
srcPtr = background;
}
samplesPerPixel = 1;
photometric = PHOTOMETRIC_MINISBLACK;
}
TIFFSetField(tifPtr, TIFFTAG_BITSPERSAMPLE, 8);
TIFFSetField(tifPtr, TIFFTAG_COMPRESSION, (unsigned short int)compress);
TIFFSetField(tifPtr, TIFFTAG_IMAGELENGTH, srcPtr->height);
TIFFSetField(tifPtr, TIFFTAG_IMAGEWIDTH, srcPtr->width);
TIFFSetField(tifPtr, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT);
TIFFSetField(tifPtr, TIFFTAG_PHOTOMETRIC, photometric);
TIFFSetField(tifPtr, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
TIFFSetField(tifPtr, TIFFTAG_RESOLUTIONUNIT, 2);
TIFFSetField(tifPtr, TIFFTAG_ROWSPERSTRIP, srcPtr->height);
TIFFSetField(tifPtr, TIFFTAG_SAMPLESPERPIXEL, samplesPerPixel);
TIFFSetField(tifPtr, TIFFTAG_SOFTWARE, TIFFGetVersion());
TIFFSetField(tifPtr, TIFFTAG_XRESOLUTION, 300.0f);
TIFFSetField(tifPtr, TIFFTAG_YRESOLUTION, 300.0f);
#ifdef WORD_BIGENDIAN
TIFFSetField(tifPtr, TIFFTAG_FILLORDER, FILLORDER_MSB2LSB);
#else
TIFFSetField(tifPtr, TIFFTAG_FILLORDER, FILLORDER_LSB2MSB);
#endif
result = -1;
{
//.........这里部分代码省略.........
示例13: ImagingTiffVersion
const char*
ImagingTiffVersion(void)
{
return TIFFGetVersion();
}
示例14: getImagelibVersions
/*!
* getImagelibVersions()
*
* Return: string of version numbers; e.g.,
* libgif 5.0.3
* libjpeg 8b
* libpng 1.4.3
* libtiff 3.9.5
* zlib 1.2.5
* libwebp 0.3.0
* libopenjp2 2.1.0
*
* Notes:
* (1) The caller has responsibility to free the memory.
*/
char *
getImagelibVersions()
{
char buf[128];
l_int32 first = TRUE;
#if HAVE_LIBJPEG
struct jpeg_compress_struct cinfo;
struct jpeg_error_mgr err;
char buffer[JMSG_LENGTH_MAX];
#endif
char *tempStrP;
char *versionNumP;
char *nextTokenP;
char *versionStrP = stringNew("");
#if HAVE_LIBGIF
first = FALSE;
stringJoinInPlace(versionStrP, "libgif ");
#ifdef GIFLIB_MAJOR
snprintf(buf, sizeof(buf), "%d.%d.%d", GIFLIB_MAJOR, GIFLIB_MINOR,
GIFLIB_RELEASE);
#else
stringCopy(buf, "4.1.6(?)", sizeof(buf));
#endif
stringJoinInPlace(versionStrP, buf);
#endif
#if HAVE_LIBJPEG
cinfo.err = jpeg_std_error(&err);
err.msg_code = JMSG_VERSION;
(*err.format_message) ((j_common_ptr ) &cinfo, buffer);
if (!first) stringJoinInPlace(versionStrP, " : ");
first = FALSE;
stringJoinInPlace(versionStrP, "libjpeg ");
versionNumP = strtokSafe(buffer, " ", &nextTokenP);
stringJoinInPlace(versionStrP, versionNumP);
FREE(versionNumP);
#endif
#if HAVE_LIBPNG
if (!first) stringJoinInPlace(versionStrP, " : ");
first = FALSE;
stringJoinInPlace(versionStrP, "libpng ");
stringJoinInPlace(versionStrP, png_get_libpng_ver(NULL));
#endif
#if HAVE_LIBTIFF
if (!first) stringJoinInPlace(versionStrP, " : ");
first = FALSE;
stringJoinInPlace(versionStrP, "libtiff ");
versionNumP = strtokSafe((char *)TIFFGetVersion(), " \n", &nextTokenP);
FREE(versionNumP);
versionNumP = strtokSafe(NULL, " \n", &nextTokenP);
FREE(versionNumP);
versionNumP = strtokSafe(NULL, " \n", &nextTokenP);
stringJoinInPlace(versionStrP, versionNumP);
FREE(versionNumP);
#endif
#if HAVE_LIBZ
if (!first) stringJoinInPlace(versionStrP, " : ");
first = FALSE;
stringJoinInPlace(versionStrP, "zlib ");
stringJoinInPlace(versionStrP, zlibVersion());
#endif
#if HAVE_LIBWEBP
{
l_int32 val;
char buf[32];
if (!first) stringJoinInPlace(versionStrP, " : ");
first = FALSE;
stringJoinInPlace(versionStrP, "libwebp ");
val = WebPGetEncoderVersion();
snprintf(buf, sizeof(buf), "%d.%d.%d", val >> 16, (val >> 8) & 0xff,
val & 0xff);
stringJoinInPlace(versionStrP, buf);
}
#endif
#if HAVE_LIBJP2K
{
const char *version;
//.........这里部分代码省略.........
示例15: getImagelibVersions
/*!
* getImagelibVersions()
*
* Return: string of version numbers; e.g.,
* libgif 5.0.3
* libjpeg 8b (libjpeg-turbo 1.3.0)
* libpng 1.4.3
* libtiff 3.9.5
* zlib 1.2.5
* libwebp 0.3.0
* libopenjp2 2.1.0
*
* Notes:
* (1) The caller must free the memory.
*/
char *
getImagelibVersions()
{
char buf[128];
l_int32 first = TRUE;
char *versionNumP;
char *nextTokenP;
char *versionStrP = NULL;
#if HAVE_LIBGIF
first = FALSE;
stringJoinIP(&versionStrP, "libgif ");
#ifdef GIFLIB_MAJOR
snprintf(buf, sizeof(buf), "%d.%d.%d", GIFLIB_MAJOR, GIFLIB_MINOR,
GIFLIB_RELEASE);
#else
stringCopy(buf, "4.1.6(?)", sizeof(buf));
#endif
stringJoinIP(&versionStrP, buf);
#endif /* HAVE_LIBGIF */
#if HAVE_LIBJPEG
{
struct jpeg_compress_struct cinfo;
struct jpeg_error_mgr err;
char buffer[JMSG_LENGTH_MAX];
cinfo.err = jpeg_std_error(&err);
err.msg_code = JMSG_VERSION;
(*err.format_message) ((j_common_ptr ) &cinfo, buffer);
if (!first) stringJoinIP(&versionStrP, " : ");
first = FALSE;
stringJoinIP(&versionStrP, "libjpeg ");
versionNumP = strtokSafe(buffer, " ", &nextTokenP);
stringJoinIP(&versionStrP, versionNumP);
FREE(versionNumP);
#if defined(LIBJPEG_TURBO_VERSION)
/* To stringify the result of expansion of a macro argument,
* you must use two levels of macros. See:
* https://gcc.gnu.org/onlinedocs/cpp/Stringification.html */
#define l_xstr(s) l_str(s)
#define l_str(s) #s
snprintf(buf, sizeof(buf), " (libjpeg-turbo %s)",
l_xstr(LIBJPEG_TURBO_VERSION));
stringJoinIP(&versionStrP, buf);
#endif /* LIBJPEG_TURBO_VERSION */
}
#endif /* HAVE_LIBJPEG */
#if HAVE_LIBPNG
if (!first) stringJoinIP(&versionStrP, " : ");
first = FALSE;
stringJoinIP(&versionStrP, "libpng ");
stringJoinIP(&versionStrP, png_get_libpng_ver(NULL));
#endif /* HAVE_LIBPNG */
#if HAVE_LIBTIFF
if (!first) stringJoinIP(&versionStrP, " : ");
first = FALSE;
stringJoinIP(&versionStrP, "libtiff ");
versionNumP = strtokSafe((char *)TIFFGetVersion(), " \n", &nextTokenP);
FREE(versionNumP);
versionNumP = strtokSafe(NULL, " \n", &nextTokenP);
FREE(versionNumP);
versionNumP = strtokSafe(NULL, " \n", &nextTokenP);
stringJoinIP(&versionStrP, versionNumP);
FREE(versionNumP);
#endif /* HAVE_LIBTIFF */
#if HAVE_LIBZ
if (!first) stringJoinIP(&versionStrP, " : ");
first = FALSE;
stringJoinIP(&versionStrP, "zlib ");
stringJoinIP(&versionStrP, zlibVersion());
#endif /* HAVE_LIBZ */
#if HAVE_LIBWEBP
{
l_int32 val;
char buf[32];
if (!first) stringJoinIP(&versionStrP, " : ");
first = FALSE;
stringJoinIP(&versionStrP, "libwebp ");
val = WebPGetEncoderVersion();
//.........这里部分代码省略.........