php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24816 ImageCopyMerge doesn't work in 4.3.2
Submitted: 2003-07-26 06:32 UTC Modified: 2003-08-03 11:22 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: jakob at gosign dot de Assigned:
Status: Closed Package: GD related
PHP Version: 4.3.2 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jakob at gosign dot de
New email:
PHP Version: OS:

 

 [2003-07-26 06:32 UTC] jakob at gosign dot de
Description:
------------
ImageCopyMerge doesn't work in PHP 4.3.2. It seems as though the source image is ignored and instead a black image is used for merging the colors. The same script works in PHP 4.3.1 as expected.

Reproduce code:
---------------
$img = ImageCreateTrueColor(100, 100);
ImageFill($img, 0, 0, ImageColorAllocate($img, 255, 255, 255));

$img2 = ImageCreateTrueColor(50, 50);
ImageFill($img2, 0, 0, ImageColorAllocate($img2, 0, 0, 0));

ImageCopyMerge($img, $img2, 0, 0, 0, 0, 50, 50, 50);

ImagePNG($img);


Expected result:
----------------
A gray box. (50% black)

Actual result:
--------------
A black box. (100% black)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-07-26 10:57 UTC] iliaa@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip

Works fine in latest CVS.
 [2003-08-01 06:08 UTC] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 [2003-08-03 05:21 UTC] mark at teckis dot com
I have also had this problem with the ImageCopyMerge function and deduced that only the colour of the overlayed (source_image) pixel is used to determine the resultant colour. The destination image/pixel is totally ignored and just coloured relative to the overlay colour.
Using a non 100 numeric for the opacity therefore just darkens the overlay colour proportionally (N% of 0-255,0-255,0-255 would always appear as though it was placed on a black dot 0,0,0 rather than whatever colour is really there)

Note: This may well be a problem with the GD version rather than the PHP build as (I'm pretty sure) it only became apparent to me when changing from GD2.0.9 to GD2.0.12

I shall request my host to apply the snapshot.
 [2003-08-03 11:01 UTC] mark at teckis dot com
CVS snapshot applied.
Problem fixed.
 [2003-08-03 11:22 UTC] iliaa@php.net
User reports that the problem has been fixed.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 02 14:01:34 2024 UTC