pajoye Thu Nov 6 10:14:38 2008 UTC
Modified files: (Branch: PHP_5_3)
/php-src/ext/gd gd.c
/php-src/ext/gd/libgd gd.h gd_jpeg.c gd_png.c
Log:
- fix build on linux (static)
- add gd[Format]Version[Int|String] first methods to work around the png
header issues
http://cvs.php.net/viewvc.cgi/php-src/ext/gd/gd.c?r1=1.312.2.20.2.32.2.22&r2=1.312.2.20.2.32.2.23&diff_format=u
Index: php-src/ext/gd/gd.c
diff -u php-src/ext/gd/gd.c:1.312.2.20.2.32.2.22
php-src/ext/gd/gd.c:1.312.2.20.2.32.2.23
--- php-src/ext/gd/gd.c:1.312.2.20.2.32.2.22 Tue Nov 4 20:25:45 2008
+++ php-src/ext/gd/gd.c Thu Nov 6 10:14:37 2008
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: gd.c,v 1.312.2.20.2.32.2.22 2008/11/04 20:25:45 pajoye Exp $ */
+/* $Id: gd.c,v 1.312.2.20.2.32.2.23 2008/11/06 10:14:37 pajoye Exp $ */
/* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center,
Cold Spring Harbor Labs. */
@@ -29,15 +29,6 @@
#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"
@@ -1395,15 +1386,16 @@
#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");
http://cvs.php.net/viewvc.cgi/php-src/ext/gd/libgd/gd.h?r1=1.26.2.3.2.6&r2=1.26.2.3.2.6.2.1&diff_format=u
Index: php-src/ext/gd/libgd/gd.h
diff -u php-src/ext/gd/libgd/gd.h:1.26.2.3.2.6
php-src/ext/gd/libgd/gd.h:1.26.2.3.2.6.2.1
--- php-src/ext/gd/libgd/gd.h:1.26.2.3.2.6 Tue Sep 11 23:34:25 2007
+++ php-src/ext/gd/libgd/gd.h Thu Nov 6 10:14:37 2008
@@ -250,6 +250,8 @@
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! */
http://cvs.php.net/viewvc.cgi/php-src/ext/gd/libgd/gd_jpeg.c?r1=1.18.4.2&r2=1.18.4.2.4.1&diff_format=u
Index: php-src/ext/gd/libgd/gd_jpeg.c
diff -u php-src/ext/gd/libgd/gd_jpeg.c:1.18.4.2
php-src/ext/gd/libgd/gd_jpeg.c:1.18.4.2.4.1
--- php-src/ext/gd/libgd/gd_jpeg.c:1.18.4.2 Sun Feb 5 15:53:58 2006
+++ php-src/ext/gd/libgd/gd_jpeg.c Thu Nov 6 10:14:37 2008
@@ -102,6 +102,11 @@
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
http://cvs.php.net/viewvc.cgi/php-src/ext/gd/libgd/gd_png.c?r1=1.17.4.2.2.5.2.1&r2=1.17.4.2.2.5.2.2&diff_format=u
Index: php-src/ext/gd/libgd/gd_png.c
diff -u php-src/ext/gd/libgd/gd_png.c:1.17.4.2.2.5.2.1
php-src/ext/gd/libgd/gd_png.c:1.17.4.2.2.5.2.2
--- php-src/ext/gd/libgd/gd_png.c:1.17.4.2.2.5.2.1 Thu Jul 31 09:23:18 2008
+++ php-src/ext/gd/libgd/gd_png.c Thu Nov 6 10:14:37 2008
@@ -36,6 +36,11 @@
---------------------------------------------------------------------------*/
+const char * gdPngGetVersionString()
+{
+ return PNG_LIBPNG_VER_STRING;
+}
+
#ifndef PNG_SETJMP_NOT_SUPPORTED
typedef struct _jmpbuf_wrapper
{
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php