pajoye          Tue Dec  3 21:37:21 2002 EDT

  Modified files:              
    /php4/ext/gd        gd.c 
  Log:
  Fix imagegd crashes when used with truecolor image (from jpeg,png, or 
imagecreatetruecolor)
  may we add parameters to imagegd to let user specify the palette size and dither 
(set to 256 and true) ?
  
  
Index: php4/ext/gd/gd.c
diff -u php4/ext/gd/gd.c:1.229 php4/ext/gd/gd.c:1.230
--- php4/ext/gd/gd.c:1.229      Thu Nov 28 17:48:20 2002
+++ php4/ext/gd/gd.c    Tue Dec  3 21:37:21 2002
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: gd.c,v 1.229 2002/11/28 22:48:20 helly Exp $ */
+/* $Id: gd.c,v 1.230 2002/12/04 02:37:21 pajoye Exp $ */
 
 /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, 
    Cold Spring Harbor Labs. */
@@ -1588,6 +1588,12 @@
                                        if(gdImageRed(im, i) == 0) break;
                                }
                                (*func_p)(im, i, fp);
+                               break;
+                       case PHP_GDIMG_TYPE_GD:
+                               if(im->trueColor){
+                                       gdImageTrueColorToPalette(im,1,255);
+                               }
+                               (*func_p)(im, fp);
                                break;
                        default:
                                (*func_p)(im, fp);



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to