#23808 [NEW]: Different behaviour of gd in blend images with 4.3.2rc4 than 4.3.1
| From: | i dot a at signalsystem-bz dot it | Date: | Mon, 26 May 2003 09:24:58 +0000 |
| Subject: | #23808 [NEW]: Different behaviour of gd in blend images with 4.3.2rc4 than 4.3.1 | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-40429@lists.php.net to get a copy of this message | ||
From: i dot a at signalsystem-bz dot it
Operating system: Win2k server
PHP version: 4.3.2RC4
PHP Bug Type: GD related
Bug description: Different behaviour of gd in blend images with 4.3.2rc4 than 4.3.1
I had under php 4.3.1 some code to blend in transparency a logo over some
pictures before displaying them - all was working perfectly.
When i installed php 4.3.2rc4, i noticed that the same code stopped
working - where first was blending 2 images, now is acting this way:
- with high transparency value in imagecopymerge, the 2nd image covers
totally the destination one and the transparent color is drawed all grey
- with low transparency value in imagecopymerge, the 2nd image transparent
color becomes very dark-black and covers the destination image
the code i'm using is below:
if (isset($_REQUEST['img'])) $img=$_REQUEST['img']; else $img='';
$b = imagecreatefromjpeg($img);
$bx = imagesx($b);
$by = imagesy($b);
ImageAlphaBlending($b, true);
$logoImage = ImageCreateFromPNG('logo.png');
$logoW = ImageSX($logoImage);
$logoH = ImageSY($logoImage);
if ($logoW > $bx or $logoH > $by)
{
$x1 = $bx;
$y1 = $bx*$logoH/$logoW;
if ($x1 > $bx or $y1 > $by)
{
$y1 = $by;
$x1 = $by*$logoW/$logoH;
}
$b1 = imagecreatetruecolor($x1,$y1);
imagecopyresampled($b1,$logoImage,0,0,0,0,$x1,$y1,$logoW,$logoH);
imageDestroy($logoImage);
$logoImage = $b1;
$logoW = $x1;
$logoH = $y1;
}
ImageCopyMerge($b,$logoImage,($bx - $logoW)/2,($by -
$logoH)/2,0,0,$logoW,$logoH,14);
imagejpeg($b,"blend.jpg",90);
imageDestroy($b);
--
Edit bug report at http://bugs.php.net/?id=23808&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=23808&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=23808&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=23808&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=23808&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=23808&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=23808&r=support
Expected behavior: http://bugs.php.net/fix.php?id=23808&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=23808&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=23808&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=23808&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=23808&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=23808&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=23808&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=23808&r=gnused