|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2007-11-06 11:04 UTC] andreythinking at gmail dot com
Description:
------------
Php-5.2.4 draw parallelepiped instead square, when recieves coordinats 0,0,0,0 (1x1 pixel).
On another sizes this fenomen disappears.
* * *
Some system features (results of command rpm -qa | grep gd):
ifplugd-0.21b-1mdk
libgdbm2-1.8.0-24mdk
sysklogd-1.4.1-5mdk
libgdk_pixbuf2.0_0-2.2.4-9mdk
libgdk-pixbuf2-0.22.0-2mdk
perl-GTK-GdkPixbuf-0.7009-1mdk
gdk-pixbuf-loaders-0.22.0-2mdk
perl-GTK-GdkImlib-0.7009-1mdk
gdm-2.4.4.7-6mdk
libgdkcardimage0-2.4.2-2mdk
No strange gd, compiled-in used.
Reproduce code:
---------------
<?php
$img=imageCreate(20,30);
$bgcolor=imageColorAllocate($img,255,0,255);
$fgcolor=imageColorAllocate($img,0,255,255);
imageFill($img,0,0,$bgcolor);
imageRectangle($img,0,0,0,0,$fgcolor);
header("content-type:image/png");
imagePNG($img);
imageColorDeallocate($img,$fgcolor);
imageColorDeallocate($img,$bgcolor);
imageDestroy($img);
?>
Expected result:
----------------
Square 1x1 pixel size.
Actual result:
--------------
Parallelepiped 1x2 pixels:
2px on Y-axis.
1px on X-axis.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 01 12:00:01 2025 UTC |
:-) I check this example on identical to firts message script. Simply, I type this example "by hands. The right code: <?php $k=imageCreate(20,30); $bgcolor=imageColorAllocate($k,255,0,255); $fgcolor=imageColorAllocate($k,0,255,255); imageFill($k,0,0,$bgcolor); imageRectangle($k,1,1,1,1,$fgcolor); #imageFilledRectangle($k,1,0,1,1,$fgcolor); #imageFilledRectangle($k,2,0,2,2,$fgcolor); #imageFilledRectangle($k,3,0,3,3,$fgcolor); #imageFilledRectangle($k,4,0,4,4,$fgcolor); #imageFilledRectangle($k,5,0,5,5,$fgcolor); header("content-type:image/png"); imagePNG($k); imageColorDeallocate($k,$fgcolor); imageColorDeallocate($k,$bgcolor); imageDestroy($k); ?> Thanks, after 12:00pm, when traffic will be half-cheaper, I try new version of PHP.