1
0
mirror of https://github.com/php/php-src.git synced 2026-04-26 09:28:21 +02:00

Move (back) missing functions in system libgd to gd_compat

- display libPng version in all cases
- gd_compat.c in ext/gd (nothing in ext/gd/libgd)
This commit is contained in:
Remi Collet
2013-05-05 09:54:27 +02:00
parent 9a48b6506c
commit 0cae9a15d7
4 changed files with 57 additions and 32 deletions
+1
View File
@@ -336,6 +336,7 @@ else
if test "$PHP_GD" != "no"; then
GD_MODULE_TYPE=external
extra_sources="gd_compat.c"
dnl Various checks for GD features
PHP_GD_ZLIB
+1 -32
View File
@@ -53,41 +53,12 @@
# include <Wingdi.h>
#endif
#ifdef HAVE_GD_JPG
# include <jpeglib.h>
#endif
#ifdef HAVE_GD_XPM
# include <X11/xpm.h>
#endif
#ifndef HAVE_GD_BUNDLED
#ifdef HAVE_GD_JPG
int gdJpegGetVersionInt()
{
return JPEG_LIB_VERSION;
}
const char * gdJpegGetVersionString()
{
switch(JPEG_LIB_VERSION) {
case 62:
return "6b";
break;
case 70:
return "7";
break;
case 80:
return "8";
break;
default:
return "unknown";
}
}
#endif /* HAVE_GD_JPG */
# include "gd_compat.h"
#endif /* HAVE_GD_BUNDLED */
static int le_gd, le_gd_font;
@@ -1350,9 +1321,7 @@ PHP_MINFO_FUNCTION(gd)
#ifdef HAVE_GD_PNG
php_info_print_table_row(2, "PNG Support", "enabled");
#ifndef HAVE_GD_BUNDLED
php_info_print_table_row(2, "libPNG Version", gdPngGetVersionString());
#endif
#endif
php_info_print_table_row(2, "WBMP Support", "enabled");
#if defined(HAVE_GD_XPM)
+47
View File
@@ -0,0 +1,47 @@
#include "php_config.h"
#ifdef HAVE_GD_PNG
/* needs to be first */
# include <png.h>
#endif
#ifdef HAVE_GD_JPG
# include <jpeglib.h>
#endif
#include "gd_compat.c"
#ifdef HAVE_GD_JPG
int gdJpegGetVersionInt()
{
return JPEG_LIB_VERSION;
}
const char * gdJpegGetVersionString()
{
switch(JPEG_LIB_VERSION) {
case 62:
return "6b";
break;
case 70:
return "7";
break;
case 80:
return "8";
break;
default:
return "unknown";
}
}
#endif
#ifdef HAVE_GD_PNG
const char * gdPngGetVersionString()
{
return PNG_LIBPNG_VER_STRING;
}
#endif
+8
View File
@@ -0,0 +1,8 @@
#ifndef GD_COMPAT_H
#define GD_COMPAT_H 1
const char * gdPngGetVersionString();
const char * gdJpegGetVersionString();
int gdJpegGetVersionInt();
#endif /* GD_COMPAT_H */