summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Joye <pajoye@php.net>2009-04-07 09:24:34 +0000
committerPierre Joye <pajoye@php.net>2009-04-07 09:24:34 +0000
commit2350110e5566b7d00780ce0f8ddde9f0b05d7a3a (patch)
tree8e75ba9fe02d35bc6b2e9441f98182061ca77d7e
parent309533842fa328d6ee1cf8f84a178abc474f3821 (diff)
downloadphp-git-2350110e5566b7d00780ce0f8ddde9f0b05d7a3a.tar.gz
- initial import, support for external gd library while keeping bug fixes or features (more will be activated later)
-rw-r--r--ext/gd/libgd/gd_compat.c35
-rw-r--r--ext/gd/libgd/gd_compat.h5
2 files changed, 40 insertions, 0 deletions
diff --git a/ext/gd/libgd/gd_compat.c b/ext/gd/libgd/gd_compat.c
new file mode 100644
index 0000000000..bba62341ca
--- /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 <png.h>
+#endif
+
+#ifdef HAVE_GD_JPG
+# include <jpeglib.h>
+#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 0000000000..086e6d2cd3
--- /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);
+