]> granicus.if.org Git - php/commitdiff
- MFB: initial import, support for external gd library while keeping bug fixes or...
authorPierre Joye <pajoye@php.net>
Tue, 7 Apr 2009 09:43:53 +0000 (09:43 +0000)
committerPierre Joye <pajoye@php.net>
Tue, 7 Apr 2009 09:43:53 +0000 (09:43 +0000)
ext/gd/libgd/gd_compat.c [new file with mode: 0644]
ext/gd/libgd/gd_compat.h [new file with mode: 0644]

diff --git a/ext/gd/libgd/gd_compat.c b/ext/gd/libgd/gd_compat.c
new file mode 100644 (file)
index 0000000..bba6234
--- /dev/null
@@ -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 (file)
index 0000000..086e6d2
--- /dev/null
@@ -0,0 +1,5 @@
+const char * gdPngGetVersionString();
+int gdJpegGetVersionString();
+int gdJpegGetVersionInt();
+int overflow2(int a, int b);
+