#34336 [Bgs]: ext/gd: imagerotate destroys transparency information
| From: | techtonik@php.net | Date: | Sat, 03 Sep 2005 12:20:46 +0000 |
| Subject: | #34336 [Bgs]: ext/gd: imagerotate destroys transparency information | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-84473@lists.php.net to get a copy of this message | ||
ID: 34336
User updated by: techtonik@php.net
Reported By: techtonik@php.net
Status: Bogus
Bug Type: Feature/Change Request
Operating System: *
PHP Version: 4CVS (2005-08-31)
Assigned To: pajoye
New Comment:
I doubt that users can call this _feature_. Should I post another bug
to be marked "won't fix" for future reference to users who will ask
again and again?
Previous Comments:
------------------------------------------------------------------------
[2005-09-03 14:17:59] techtonik@php.net
>> Why it is impossible to change the behavior to keep
>> transparency by default?
> BC Break, and second as you see with your picture, it is
> not the best result you can have, people tend to mix
> transparec and transparent color.
What do you mean by "transparec and transparent color"?
> There is an interpolation, which range to use to ignore
> the bgd color or a transparent color? There is no easy
> way without making the function way too complex.
But what if bgd color is transparent color?
>> Why change transparent to black while rotating in PHP4?
> It's a new _feature_. We do not add new feature to PHP4
> and/or PHP5.0
I doubt that users can call changing transparent color to black while
rotating. This doesn't seem like a feature to me, sorry.
------------------------------------------------------------------------
[2005-09-03 12:10:10] pajoye@php.net
> JFY, a new fourth parameter "ignore_transparent" was
> already added to imagerotate in PHP 5.1 - see
I added it in HEAD after 5.0.x was branched, but thx for the notice :)
> Why it is impossible to change the behavior to keep
> transparency by default?
BC Break, and second as you see with your picture, it is not the best
result you can have, people tend to mix transparec and transparent
color. There is an interpolation, which range to use to ignore the bgd
color or a transparent color? There is no easy way without making the
function way too complex.
> Why change transparent to black while rotating in PHP4?
It's a new _feature_. We do not add new feature to PHP4 and/or PHP5.0
Status closed then
--Pierre
------------------------------------------------------------------------
[2005-09-03 00:36:29] techtonik@php.net
JFY, a new fourth parameter "ignore_transparent" was already added to
imagerotate in PHP 5.1 - see http://php.net/imagerotate
------------------------------------------------------------------------
[2005-09-03 00:06:30] techtonik@php.net
Well, it works for PHP5, but what to do with PHP4?
Why it is impossible to change the behavior to keep transparency by
default?
Why change transparent to black while rotating in PHP4?
It still seems like a bug to me.
Why this doesn't work either?
...
$sprTransparent = imagecolortransparent($spr);
//sprite rotation
$rotate = 15;
$spr = imagerotate($spr, $rotate, $sprTransparent);
$sprTransparent = imagecolortransparent($spr, $sprTransparent);
...
------------------------------------------------------------------------
[2005-09-02 10:10:10] pajoye@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5-win32-latest.zip
Try the newly added 4th argument:
imagerotate($rsr, $angle, $bg_color, $keeptransparency);
However, note that this is interpolated colors in the destination
images (rotated), meaning that if the original image has some
antialiased artifacts with the bgd color, you will notice them in the
rotated image (in your case, a white border), not much can be done
against that.
--Pierre
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/34336
--
Edit this bug report at http://bugs.php.net/?id=34336&edit=1