#44429 [Opn->Fbk]: problem with alpha in imagerotate, only for gifs
| From: | pajoye@php.net | Date: | Wed, 21 May 2008 11:01:54 +0000 |
| Subject: | #44429 [Opn->Fbk]: problem with alpha in imagerotate, only for gifs | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-125156@lists.php.net to get a copy of this message | ||
ID: 44429
Updated by: pajoye@php.net
Reported By: deepmindster at gmail dot com
-Status: Open
+Status: Feedback
Bug Type: GD related
Operating System: linux
PHP Version: 5.2.5
-Assigned To:
+Assigned To: pajoye
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2008-03-13 13:00:57] 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
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=44429&edit=1