Bug #51671 [Com]: imagefill does not work correctly for small images
| From: | a dot schilder at gmx dot de | Date: | Tue, 27 Apr 2010 11:12:00 +0000 |
| Subject: | Bug #51671 [Com]: imagefill does not work correctly for small images | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-149951@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=51671&edit=1
ID: 51671
Comment by: a dot schilder at gmx dot de
Reported by: a dot schilder at gmx dot de
Summary: imagefill does not work correctly for small images
Status: Assigned
Type: Bug
Package: GD related
Operating System: Windows XP SP3
PHP Version: 5.3.2
Assigned To: pajoye
New Comment:
I also tested it with imagecreate() instead of imagecreatetruecolor()
and then it worked. Although it's said in the docs that
imagecreatetruecolor() does not work with gif images, that's not true -
it works in all cases, except in this example (see also bug #51414 for
this doc problem).
The code is taken from a class that creates an image and outputs it in
different formats - so imagecreatetruecolor() has to be used, because
the output format is not known on image creation.
Previous Comments:
------------------------------------------------------------------------
[2010-04-27 09:22:01] a dot schilder at gmx dot de
Description:
------------
I try to use imagefill() with an image that has a width of one pixel,
but it does not work. For larger image it works as expected.
Test script:
---------------
// image 1
$image = imagecreatetruecolor(50, 50);
$white = imagecolorallocate($image, 255, 255, 255);
imagefill($image, 0, 0, $white);
imagegif($image, __DIR__ . '/50x50.gif');
// image 2
$image = imagecreatetruecolor(1, 50);
$white = imagecolorallocate($image, 255, 255, 255);
imagefill($image, 0, 0, $white);
imagegif($image, __DIR__ . '/1x50.gif');
Expected result:
----------------
1) White image, 50x50 pixel.
2) White image, 1x50 pixel.
Actual result:
--------------
1) White image, 50x50 pixel.
2) Image, 1x50 pixel, with the first two pixels (0/0, 1/0) in white, the
rest in the default color (black).
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=51671&edit=1