#include "config.h"
#endif
-#ifdef HAVE_GD_PNG
-/* needs to be first */
-#include <png.h>
-#endif
-#ifdef HAVE_GD_JPG
-/* needs to be first */
-#include <jpeglib.h>
-#endif
-
#include "php.h"
#include "php_ini.h"
#include "ext/standard/head.h"
#endif
#ifdef HAVE_GD_JPG
{
- char tmp[256];
- snprintf(tmp, sizeof(tmp), "%d", JPEG_LIB_VERSION);
+ char tmp[12];
+ snprintf(tmp, sizeof(tmp), "%d", gdJpegGetVersionInt());
php_info_print_table_row(2, "JPG Support", "enabled");
- php_info_print_table_row(2, "libJPEG Version", tmp);
+ php_info_print_table_row(2, "libPNG Version", tmp);
}
#endif
+
#ifdef HAVE_GD_PNG
php_info_print_table_row(2, "PNG Support", "enabled");
- php_info_print_table_row(2, "libPNG Version", PNG_LIBPNG_VER_STRING);
+ php_info_print_table_row(2, "libPNG Version", gdPngGetVersionString());
#endif
#ifdef HAVE_GD_WBMP
php_info_print_table_row(2, "WBMP Support", "enabled");
gdImagePtr gdImageCreateFromJpeg(FILE *infile, int ignore_warning);
gdImagePtr gdImageCreateFromJpegCtx(gdIOCtx *infile, int ignore_warning);
+int gdJpegGetVersionInt();
+const char * gdPngGetVersionString();
/* A custom data source. */
/* The source function must return -1 on error, otherwise the number
of bytes fetched. 0 is EOF, not an error! */
exit (99);
}
+int gdJpegGetVersionInt()
+{
+ return JPEG_LIB_VERSION;
+}
+
/*
* Write IM to OUTFILE as a JFIF-formatted JPEG image, using quality
* QUALITY. If QUALITY is in the range 0-100, increasing values
---------------------------------------------------------------------------*/
+const char * gdPngGetVersionString()
+{
+ return PNG_LIBPNG_VER_STRING;
+}
+
#ifndef PNG_SETJMP_NOT_SUPPORTED
typedef struct _jmpbuf_wrapper
{