Bug #14974: Transparency with ImageCopy
| From: | cyril at pernin dot net | Date: | Thu, 10 Jan 2002 19:13:37 +0000 |
| Subject: | Bug #14974: Transparency with ImageCopy | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-76521@lists.php.net to get a copy of this message | ||
From: cyril@pernin.net
Operating system: WIN / LINUX
PHP version: 4.0.6
PHP Bug Type: GD related
Bug description: Transparency with ImageCopy
with GD
if i copy a part of a pict2.png (with tranparency set) in an other
pict1.png.
GD 1.0.6 give me : the picct1.png image is visible under the tranparency
zone of the copied image (pict1.png)... :)
GD 2.0 (same script) the same zone is transparent :(
what can i do?
here is the script:
<?php
function LoadGif ($xxxmgname) {
$xxxm = @ImageCreateFromPNG ($xxxmgname);
$bg = ImageColorAllocate ($xxxm, 255, 255, 255);
return $xxxm;
}
header ("Content-type: image/PNG ");
$xxxm = @ImageCreate (450, 300) or die ("Cannot Initialize new GD image
stream");
$bg = ImageColorAllocate ($xxxm, 255, 255, 255);
imagecolortransparent($xxxm, $bg);
$couleurnoms = ImageColorAllocate ($xxxm, 250, 250, 250);
$xxxm=loadgif ("vierge.png");
$paysages=loadgif ("images.png");
ImageCopy ($xxxm,$paysages, 150, 100, 261, 196, 63, 63);
$color=imagecolorstotal ($xxxm);
ImageString ($xxxm, 2, 10, 250, "$color couleurs", $couleurnoms);
ImagePNG ($xxxm);// Imagejpeg($im,'',20);
ImageDestroy ($xxxm);
?>
--
Edit bug report at: http://bugs.php.net/?id=14974&edit=1