From:             kraus at phoenixwebsolutions dot de
Operating system: Linux
PHP version:      5.1.2
PHP Bug Type:     GD related
Bug description:  Transparency is lost when using imagecreatetruecolor

Description:
------------
If the function imagecreatetruecolor function is used instead of
imagecreate the transparent color seems to get lost when scaling down the
color palette if the image is exported as gif.

Reproduce code:
---------------
<?php
header ("Content-type: image/png");
$im = @imagecreatetruecolor(50, 100)
      or die ("Kann keinen neuen GD-Bild-Stream erzeugen");
#$im = @imagecreate(50, 100)
#      or die ("Kann keinen neuen GD-Bild-Stream erzeugen");
$background_color = ImageColorAllocate ($im, 100, 100, 100);
$rect_color = ImageColorAllocate ($im, 200, 0, 0);
ImageFilledRectangle($im,0,0,50,100,$backgroundcolor);
ImageFilledRectangle($im,0,0,50,50,$rect_color);
$text_color = ImageColorAllocate ($im, 233, 14, 91);

ImageString ($im, 1, 5, 5, "Ein Test-String", $text_color);
$res = imagecolortransparent($im, $background_color);
#var_dump($res);var_dump($background_color);
ImageGIF($im);

?>



-- 
Edit bug report at http://bugs.php.net/?id=36697&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=36697&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): 
http://bugs.php.net/fix.php?id=36697&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=36697&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=36697&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=36697&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=36697&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=36697&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=36697&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=36697&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=36697&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=36697&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=36697&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=36697&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=36697&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=36697&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=36697&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=36697&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=36697&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=36697&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=36697&r=mysqlcfg

Reply via email to