From:             hp at oeri dot ch
Operating system: Windows XP
PHP version:      5.0.2
PHP Bug Type:     GD related
Bug description:  imagecolortransparent and imagetruecolortopalette don't mix

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 bug report at http://bugs.php.net/?id=30863&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=30863&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=30863&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=30863&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=30863&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=30863&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=30863&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=30863&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=30863&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=30863&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=30863&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=30863&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=30863&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=30863&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=30863&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=30863&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=30863&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=30863&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=30863&r=float
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=30863&r=mysqlcfg

Reply via email to