php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44429 problem with alpha in imagerotate, only for gifs
Submitted: 2008-03-13 13:00 UTC Modified: 2008-05-29 01:00 UTC
Votes:2
Avg. Score:4.0 ± 1.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: deepmindster at gmail dot com Assigned: pajoye (profile)
Status: No Feedback Package: GD related
PHP Version: 5.2.5 OS: linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2008-03-13 13:00 UTC] deepmindster at gmail dot com
Description:
------------
Hello. Looks like imagerotate do not save alpha for gifs.. 

There is example of code:



Reproduce code:
---------------
<?php

$im = imagecreatefrompng( dirname( $_SERVER['SCRIPT_FILENAME'] ) . '/gifs/0.png' );
$tr = imagecolortransparent( $im );
$r = imagerotate( $im, 45., $tr );
imagesavealpha( $r, true );

//Png works perfect
//header( 'Content-type: image/png' ); 
//imagepng( $r );

//Gifs does not works.. black or while or gray background.. :(
header( 'Content-type: image/gif' );
imagegif( $r );

?>

Expected result:
----------------
it should be rotated transparent image

Actual result:
--------------
background color instead transparent background

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-05-21 11:01 UTC] pajoye@php.net
It is certainly due to the transparent color not being set in your new rotated image.

You can use the 3rd argument to define which color you like to have for the borders.

However, if your problem persists, I need the original PNG image to reproduce it.
 [2008-05-29 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 07 08:01:32 2024 UTC