cvs: pear /Image_Transform/Driver GD.php

[email protected] ("Christian Weiske")
Newsgroups php.pear.cvs
Message-ID <cvscweiske1209419766@cvsserver>
cweiske		Mon Apr 28 21:56:06 2008 UTC

  Modified files:              
    /pear/Image_Transform/Driver	GD.php 
  Log:
  fix bug #117: GD Driver doesn't preserve transparency while resizing
  (gd works now the same way as cairo, IM and imagick3. only netpbm doesn't
  preserve transparency yet)
  
  
http://cvs.php.net/viewvc.cgi/pear/Image_Transform/Driver/GD.php?r1=1.37&r2=1.38&diff_format=u
Index: pear/Image_Transform/Driver/GD.php
diff -u pear/Image_Transform/Driver/GD.php:1.37 pear/Image_Transform/Driver/GD.php:1.38
--- pear/Image_Transform/Driver/GD.php:1.37	Mon Apr 28 21:08:57 2008
+++ pear/Image_Transform/Driver/GD.php	Mon Apr 28 21:56:06 2008
@@ -21,7 +21,7 @@
  * @author     Philippe Jausions <[email protected]>
  * @copyright  2002-2005 The PHP Group
  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
- * @version    CVS: $Id: GD.php,v 1.37 2008/04/28 21:08:57 cweiske Exp $
+ * @version    CVS: $Id: GD.php,v 1.38 2008/04/28 21:56:06 cweiske Exp $
  * @link       http://pear.php.net/package/Image_Transform
  */
 
@@ -576,6 +576,8 @@
         if ($createtruecolor
             && function_exists('ImageCreateTrueColor')) {
             $new_img = @ImageCreateTrueColor($width, $height);
+            imagealphablending($new_img, false);
+            imagesavealpha($new_img, true);
         }
         if (!$new_img) {
             $new_img = ImageCreate($width, $height);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.