From 086765ff17972ddae8574be3ff2385ed2cbc8db7 Mon Sep 17 00:00:00 2001 From: Pierre Joye Date: Tue, 7 Apr 2009 09:43:53 +0000 Subject: [PATCH] - MFB: initial import, support for external gd library while keeping bug fixes or features (more will be activated later) --- ext/gd/libgd/gd_compat.c | 35 +++++++++++++++++++++++++++++++++++ ext/gd/libgd/gd_compat.h | 5 +++++ 2 files changed, 40 insertions(+) create mode 100644 ext/gd/libgd/gd_compat.c create mode 100644 ext/gd/libgd/gd_compat.h diff --git a/ext/gd/libgd/gd_compat.c b/ext/gd/libgd/gd_compat.c new file mode 100644 index 00000000000..bba62341ca7 --- /dev/null +++ b/ext/gd/libgd/gd_compat.c @@ -0,0 +1,35 @@ +#include "php_config.h" +#ifdef HAVE_GD_PNG +/* needs to be first */ +# include +#endif + +#ifdef HAVE_GD_JPG +# include +#endif + +#ifdef HAVE_GD_JPG +int gdJpegGetVersionInt() +{ + return JPEG_LIB_VERSION; +} + +int gdJpegGetVersionString() +{ + switch(JPEG_LIB_VERSION) { + case 62: + return "6b"; + break; + default: + return "unknown"; + } +} +#endif + +#ifdef HAVE_GD_PNG +const char * gdPngGetVersionString() +{ + return PNG_LIBPNG_VER_STRING; +} +#endif + diff --git a/ext/gd/libgd/gd_compat.h b/ext/gd/libgd/gd_compat.h new file mode 100644 index 00000000000..086e6d2cd3c --- /dev/null +++ b/ext/gd/libgd/gd_compat.h @@ -0,0 +1,5 @@ +const char * gdPngGetVersionString(); +int gdJpegGetVersionString(); +int gdJpegGetVersionInt(); +int overflow2(int a, int b); +