|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24594 IMG_COLOR_TILED and imagefill not working with all images
Submitted: 2003-07-10 11:59 UTC Modified: 2003-07-23 11:10 UTC
From: jakmania at libertysurf dot fr Assigned: pajoye (profile)
Status: Closed Package: GD related
PHP Version: 4.3.3RC2-dev OS: All
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
31 + 20 = ?
Subscribe to this entry?

 [2003-07-10 11:59 UTC] jakmania at libertysurf dot fr
If you "imagesettile" on an image created through "imagecreate" then use "imagefill" and "IMG_COLOR_TILED" as color as explained in the documentation, it's fine. But if the basic image is not created on the fly, eg. it is imported through "imagecreatefromXXX" then your "tile image" won't be apply on that image :-)
NB: any version of GD, even the bundled one.
See an example of NOT working code below.

Reproduce code:
header ("Content-type: image/png");
$im = imagecreatefrompng("basic.png"); /* 200 x 200 */
$im = imagecreatefrompng("tile.png"); /* 10 x 10 */
imagesettile($im, $tily);

Expected result:
basic.png (a map in fact) tiled on a delimited area (a country).

Actual result:
Just the basic image (basic.png), not tiled at all.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-07-10 12:21 UTC]
Here's my test script:

header ("Content-type: image/png");
$im = imagecreatefrompng("basic.png"); /* 200 x 200 */
$tile = imagecreatefrompng("tile.png"); /* 10 x 10 */
imagesettile($im, $tile);
// imagefilledpolygon ($im, array(0,0,200,0,200,200,0,200), 4, IMG_COLOR_TILED); // Works
// imagefilledrectangle ($im, 10,10,190,190, IMG_COLOR_TILED); // Works
imagefill($im,10,10,IMG_COLOR_TILED); // Does not work?

But when I used imagefill(), it only draw one line in the top with the tile and the tile image was somewhat scaled down..(I'm not sure if it's supposed to work like this? :)

# file tile.png 
tile.png: PNG image data, 10 x 10, 8-bit/color RGB, non-interlaced
# file basic.png 
basic.png: PNG image data, 200 x 200, 8-bit/color RGB, non-interlaced

 [2003-07-10 16:07 UTC] jakmania at libertysurf dot fr
Well, It should work with imagefill() just like it does with other functions (imagefilledrectangle...) I mean, just filling  with the tile, not only drawing a 'kind' of line or just doing nothing.
Someone should check GD. If this problem doesn't occur with the C version itself, or with a Perl interface, then it's a PHP bug, otherwise it's a GD bug.
 [2003-07-12 02:35 UTC] jakmania at libertysurf dot fr
It's a GD bug, not a PHP one, 'cause I've got the same wrong result in perl :(((
 [2003-07-13 15:22 UTC]
I cannot reproduce it here, using the RC or the head. Do you have a link with the 2 used images?


 [2003-07-14 12:27 UTC] jakmania at libertysurf dot fr
Hi Pierre,
Here are two images I've got the bug with:
sometimes my host is down :(, so try later in case

And the code is:

header ("Content-type: image/png");
$im = imagecreatefrompng("basic.png"); /* 150 x 150 */
$tily = imagecreatefrompng("tile.png"); /* 10 x 10 */
imagesettile($im, $tily);

I just get a dotted line (y=75)
Waiting for better news. Thanks

 [2003-07-14 12:33 UTC]
Assigning to Pierre who already has some fix for this too.

 [2003-07-23 11:10 UTC]
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at
In case this was a documentation problem, the fix will show up soon at

In case this was a website problem, the change will show
up on the site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Fri Jul 03 18:01:26 2020 UTC