pajoye          Thu Nov  6 10:23:52 2008 UTC

  Modified files:              
    /php-src/ext/gd     gd.c 
    /php-src/ext/gd/libgd       gd.h gd_jpeg.c gd_png.c 
  Log:
  - MFH: 
   - Fix linux build (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.398&r2=1.399&diff_format=u
Index: php-src/ext/gd/gd.c
diff -u php-src/ext/gd/gd.c:1.398 php-src/ext/gd/gd.c:1.399
--- php-src/ext/gd/gd.c:1.398   Tue Nov  4 20:24:46 2008
+++ php-src/ext/gd/gd.c Thu Nov  6 10:23:52 2008
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: gd.c,v 1.398 2008/11/04 20:24:46 pajoye Exp $ */
+/* $Id: gd.c,v 1.399 2008/11/06 10:23:52 pajoye Exp $ */
 
 /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center,
    Cold Spring Harbor Labs. */
@@ -29,11 +29,6 @@
 #include "config.h"
 #endif
 
-#ifdef HAVE_GD_PNG
-/* needs to be first */
-#include <png.h>
-#endif
-
 #include "php.h"
 #include "php_ini.h"
 #include "ext/standard/head.h"
@@ -60,6 +55,15 @@
 
 #if HAVE_LIBGD
 
+#ifdef HAVE_GD_PNG
+/* needs to be first */
+# include <png.h>
+#endif
+
+#ifdef HAVE_GD_JPG
+# include <jpeglib.h>
+#endif
+
 static int le_gd, le_gd_font;
 #if HAVE_LIBT1
 #include <t1lib.h>
@@ -1328,15 +1332,15 @@
 #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);
        }
 #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
        php_info_print_table_row(2, "WBMP Support", "enabled");
 #if defined(HAVE_GD_XPM) && defined(HAVE_GD_BUNDLED)
http://cvs.php.net/viewvc.cgi/php-src/ext/gd/libgd/gd.h?r1=1.34&r2=1.35&diff_format=u
Index: php-src/ext/gd/libgd/gd.h
diff -u php-src/ext/gd/libgd/gd.h:1.34 php-src/ext/gd/libgd/gd.h:1.35
--- php-src/ext/gd/libgd/gd.h:1.34      Tue Sep 11 21:31:14 2007
+++ php-src/ext/gd/libgd/gd.h   Thu Nov  6 10:23:52 2008
@@ -246,6 +246,9 @@
 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.21&r2=1.22&diff_format=u
Index: php-src/ext/gd/libgd/gd_jpeg.c
diff -u php-src/ext/gd/libgd/gd_jpeg.c:1.21 php-src/ext/gd/libgd/gd_jpeg.c:1.22
--- php-src/ext/gd/libgd/gd_jpeg.c:1.21 Sat Feb  4 14:56:58 2006
+++ php-src/ext/gd/libgd/gd_jpeg.c      Thu Nov  6 10:23:52 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.25&r2=1.26&diff_format=u
Index: php-src/ext/gd/libgd/gd_png.c
diff -u php-src/ext/gd/libgd/gd_png.c:1.25 php-src/ext/gd/libgd/gd_png.c:1.26
--- php-src/ext/gd/libgd/gd_png.c:1.25  Thu Jul 31 09:23:59 2008
+++ php-src/ext/gd/libgd/gd_png.c       Thu Nov  6 10:23:52 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

Reply via email to