#30863 [Opn->Bgs]: imagecolortransparent and imagetruecolortopalette don't mix
| From: | pajoye@php.net | Date: | Tue, 23 Nov 2004 14:30:07 +0000 |
| Subject: | #30863 [Opn->Bgs]: imagecolortransparent and imagetruecolortopalette don't mix | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-69372@lists.php.net to get a copy of this message | ||
ID: 30863
Updated by: pajoye@php.net
Reported By: hp at oeri dot ch
-Status: Open
+Status: Bogus
Bug Type: GD related
Operating System: Windows XP
PHP Version: 5.0.2
-Assigned To:
+Assigned To: pajoye
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
Use dithering to get out of that. The color approximation (even with
2colors..) is "better".
--Pierre
Previous Comments:
------------------------------------------------------------------------
[2004-11-22 16:53:06] hp at oeri dot ch
Description:
------------
If I create a truecolor image and
a) set a color as transparent
b) use imagetruecolortopalette
the result is offset by one in "x" direction and a black vertical line
at x=0.
Leaving out either a or b gives the correct result (no offset).
Didn't find this bug anywhere, am however unable to compile on Windows.
Reproduce code:
---------------
<?php
header( "Content-Type: image/png" );
$im = imagecreatetruecolor( 750, 400 );
$bg = imagecolorallocate( $im, 0xFF, 0xAA, 0xAA );
imagecolortransparent( $im, $bg ); // EITHER THIS
imagefilledrectangle( $im, 0, 0, 749, 399, $bg );
$c2 = imagecolorallocate( $im, 0x01, 0x23, 0x45 );
imagerectangle( $im, 0, 0, 749, 399, $c2 );
imagetruecolortopalette( $im, false, 256 ); // OR THAT
imagepng( $im );
?>
Expected result:
----------------
palette image, 750x400 with a rectangle along the borders
Actual result:
--------------
palette image, 750x400, with a rectangle open to the right (offset 1)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=30863&edit=1