php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41624 Alpha channel lost when using imagerotate
Submitted: 2007-06-07 12:36 UTC Modified: 2008-03-04 03:44 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: matthijs at hendrikx-itc dot nl Assigned: pajoye (profile)
Status: Not a bug Package: GD related
PHP Version: 5.2.3 OS: Any
Private report: No CVE-ID: None
 [2007-06-07 12:36 UTC] matthijs at hendrikx-itc dot nl
Description:
------------
When using imagerotate to rotate an image with an alpha channel, imagerotate removes the alpha channel.

Reproduce code:
---------------
https://hitc5.hendrikx-itc.nl/phpbug/

Expected result:
----------------
A rotated image with alpha channel, thus being transparent.

Actual result:
--------------
An opaque rotated image.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-03-04 03:44 UTC] pajoye@php.net
Sorry for the delay, I somehow did not see this bug report. It is already fixed, you only have to actually save the alpha information in the png image:

$im2 = imagerotate($img, 20, 0); 
imagesavealpha($im2,1); // << here
imagepng($im2, 'a.png');

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 27 02:01:29 2024 UTC